Hibernate Prepared Statement Logging
To log the queries executed by hibernate, add a logger ‘org.hibernate.SQL’ with debug log level and to log the parameter values of the prepared statement add ‘org.hibernate.type’ with trace log level.
An sample trace would look like
Hibernate: insert into ComponentGroup (name, id) values (?, ?)
19:23:40,753 TRACE StringType:151 – binding ‘group1’ to parameter: 1
19:23:40,754 TRACE LongType:151 – binding ‘1’ to parameter: 2
Reference Hibernate Core Reference Guide
Posted on March 20, 2011, in hibernate and tagged hibernate, logging. Bookmark the permalink. Leave a comment.
Leave a comment
Comments 0