Support Article

How to enable Hibernate logging

SA-27680

Summary



How to enable Hibernate logging for the application?

Resolution



Follow the steps given below to enable the hibernate logging in the application:

1. In the location <workspace location>/ChordiantEAR/config/chordiant/hibernate/, three files, listed below, are present for out-of-the-box modules and services:

UserProfileObjects.cfg.xml
hibernate_QRST.cfg.xml
hibernate_JXB_XA.cfg.xml

Set show_sql tag to true in the files:
<property name="show_sql">true</property>

If there are any custom .cfg.xml files listed in this location, set show_sql to true in those files too.

2. In the location <workspace location>\ChordiantEAR\config\chordiant\ we have log4j.properties file, uncomment the line log4j.logger.org.hibernate.type=DEBUG in the log4j.properties file as shown below.

#Hibernate Logging
#uncomment hibernate.type=DEBUG for detailed log4j logging
#if hibernate show_sql=true is set in hibernate.cfg file
log4j.logger.org.hibernate.type=DEBUG

3. Publish and restart the server to pickup the changes. The sysout logs will have the hibernage logs as well.

Published September 7, 2016 - Updated September 15, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.