This documentation relates to an early version of Confluence.
View this page in the current documentation or visit the current documentation home.

Enabling detailed Hibernate logging

All Versions
Click for all versions
Confluence 2.5.4 to 2.5.8 Documentation

Index

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

Labels

hibernate hibernate Delete
logging logging Delete
database database Delete
debugging debugging Delete
support support Delete
confluence confluence Delete
troubleshooting troubleshooting Delete
diagnostics diagnostics Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.