I have a tomcat app using hibernate. When I go into the WEB-INF and change the log4j.properties to the following…
log4j.logger.net.sf.hibernate.SQL=trace
But I am not seeing anything in the log file I am using.
log4j.rootLogger=debug, stdout
....
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
Logging seems to work fine for my own app.
Any ideas?
Not sure on this, but I think newer Hibernate-versions might use slf4j instead of log4j. You can get past this by using a slf4j-log4j -bridge. If you’re using Maven, the dependency is along the lines of
Modify versions as necessary.