Wednesday, September 5, 2007

Hibernate logging

There are two different configurations for Hibernate logging.

In order to log the SQL statements in a readable fashion, place the following parameters in the hibernate.cfg.xml file:

<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>

In order to log the JDBC paramaters, place the following entry in the log4j.xml file:

<category name="org.hibernate.type">
<priority value="DEBUG"/>
</category>

No comments: