title: How to configure commons-logging for JUnit testing of Hibernate
body: <p>I'm trying to debug some hibernate functionality in a spring app with a junit test and commons logging, but I can't seem to get anything other than the default INFO messages to appear. I'm also running these junit tests from Eclipse.</p>
  
  <p>I've had no luck from the spring forums either.</p>
  
  <p>I'm particularly interested in the debug logging output by Hibernate (to try and figure out why it takes 23 seconds to run this test).</p>
  
  <p>Current output shows the default setting of INFO:</p>
  
  <pre>Mar 29, 2011 4:44:35 PM org.springframework.test.AbstractTransactionalSpringContextTests onSetUp
  INFO: Began transaction: transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@5f873eb2]; defaultRollback true
  testGetSubjectsForSite time: [00:00:00:068]
  Mar 29, 2011 4:44:58 PM org.springframework.test.AbstractTransactionalSpringContextTests endTransaction
  INFO: Rolled back transaction after test execution</pre>
  
  <p>I've tried to add a commons-logging.properties file to the classpath (the same location as the hibernate.properties and test-components.xml) but still only the default INFO messages appear.</p>
  
  <p>Here's the commons-logging.properties file:</p>
  
  <pre><code>org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
  
  # handlers
  handlers=java.util.logging.ConsoleHandler
  
  # default log level
  .level=FINE
  org.springframework.level=FINE
  org.hibernate.level=FINE
  
  # level for the console logger
  java.util.logging.ConsoleHandler.level=FINE
  java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
  </code></pre>
  
  <p>Is anyone able to shed any light on why I can't get the DEBUG messages to print out? Is there a logging setting I'm missing?</p>
  
  <p><strong>Edit:</strong> I've tried FINEST and DEBUG to no avail.</p>