Archive | July, 2007

19 July 2007 ~ 0 Comments

Better Hibernate Logging with log4j

“I’m the Boss Man, Need the Info!”
Want to see not only the SQL statements that Hibernate generates, but also the parameters it binds to them, and the results it gets back? I did too.
Here’s how:
First, set Hibernate’s show_sql to false (if you’re using it)
Second, add the following to your log4j.properties file:

log4j.logger.org.hibernate.SQL=debug
log4j.logger.org.hibernate.type=trace
Log4j will now [...]

Continue Reading