I feel kind of dumb asking this because I'm sure it's a problem between the chair and keyboard, but I am not able to get Hibernate to log any messages using Log4j. I've debugged the Hibernate code and it jumps right over all logging statements. I'm using Hibernate 2.1.
I know Hibernate is reading the log4j.properties file because if I put in something invalid in it Hibernate complains.
Log4j.properties is in my classpath. Other debug messages outside of Hibernate in my own app are logging properly. The only other thing I can think of is that I'm using Spring and Hibernate together and that is causing some problem.
With hibernate.show_sql=true, I do see the sql in my console so some things are logging properly.
Is there something in my hibernate.properties that I need to have to turn on logging for debug, info, trace etc messages?
I'm at a loss here. Any help would be appreciated.
Log4j.properties
Code:
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
#log4j.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
### direct messages to file hibernate.log ###
#log4j.appender.file=org.apache.log4j.FileAppender
#log4j.appender.file.File=hibernate.log
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=warn, stdout
log4j.logger.net.sf.hibernate=debug
### log just the SQL
#log4j.logger.net.sf.hibernate.SQL=debug
### log JDBC bind parameters ###
log4j.logger.net.sf.hibernate.type=debug
### log schema export/update ###
log4j.logger.net.sf.hibernate.tool.hbm2ddl=debug
### log cache activity ###
#log4j.logger.net.sf.hibernate.cache=debug
### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace
log4j.logger.com.amfam.dmie=debug
Thanks,
joatmon