Dashboard > Confluence User Guides and Documents > ... > Troubleshooting & Technical Support > Enabling detailed Hibernate logging
Enabling detailed Hibernate logging Log In   View a printable version of the current page.

Added by ivan@atlassian.com, last edited by ivan@atlassian.com on Jun 27, 2007  (view change) show comment
Labels: 

These instructions increase Confluence's logging to report individual requests being sent to the database by Hibernate. It is useful for troubleshooting:

  • XML site backups that fail to import
  • Exceptions caused by an illegal database operation

To do this in Confluence, you need to modify log4j.properties, located in confluence/WEB-INF/classes.

If you require support assistance with a database related problem, it is advisable to enable hibernate logging prior sending us the log files. It will assists us determining what SQL queries were running during the reported problem.

To log SQL queries

Stop Confluence, then uncomment the following lines in log4j.properties:

## log hibernate prepared statements/SQL queries (equivalent to setting 'hibernate.show_sql' to 'true')
log4j.logger.net.sf.hibernate.SQL=DEBUG, confluencelog
log4j.additivity.net.sf.hibernate.SQL=false

To log SQL queries with parameters

Stop Confluence, then uncomment the following lines in log4j.properties:

## log hibernate prepared statement parameter values
log4j.logger.net.sf.hibernate.type=DEBUG, confluencelog
log4j.additivity.net.sf.hibernate.type=false

To disable batched updates (for simpler debugging)

Stop Confluence, then edit confluence/WEB-INF/classes/databaseSubsystemContext.xml and uncomment the following <prop> line:

<!-- it can be useful to disable batching during debugging, as HSQLDB doesn't report the exact statement which fails in batch mode -->
<prop key="hibernate.jdbc.batch_size">0</prop>

Related Topic

Troubleshooting SQL exceptions

DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.1 Build:#916 Nov 09, 2007) - Bug/feature request - Contact Administrators