title: JDBC logging to file
body: <p>I need to log all the queries to an Oracle database in my project to a log file.</p>
  
  <p>What would be a <em>good</em> solution to achieve this? Some sample usage would be appreciated.</p>
  
  <p>I have looked at <a href="http://www.slf4j.org/" rel="noreferrer">SLF4J</a> with <a href="http://code.google.com/p/jdbcdslog/" rel="noreferrer">jdbcdslog</a>, but I'm not sure how I can log to a file with it. Moreover, I would need to "filter" some of the logs (because I don't need to know when some <code>getxxxx</code> method get's invoked)</p>
  
  <p>Preferably, I'd prefer to use <code>java.util.logging</code> but it is not a requirement.</p>
  
  <p>Thanks.</p>
  
  <p>** <strong>UPDATE</strong> **</p>
  
  <p>I found <a href="http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/diagnose.htm" rel="noreferrer">this Oracle article</a>, however it does not really tell how to programatically do the same thing.</p>