Wednesday, July 6, 2011

Using log4j to Print Hibernate SQL and Parameters

Here are some handy log4j entries to print out what hibernate is doing behind the scenes:
log4j.logger.org.hibernate.SQL=DEBUG -- This will output the SQL hibernate generates. log4j.logger.org.hibernate.type=TRACE -- This will show the bind variable values hibernate is using.