Confluence 2.9 : Working with Confluence Logs
This page last changed on Aug 04, 2008 by jlargman.
Confluence uses Apache's log4j logging service. This allows a developer or administrator to control the logging behavior and the log output file by editing a configuration file, without touching the application binary. There are six known log4j logging levels. On this page: Error formatting macro: toc: java.lang.NullPointerException
Finding the Log Configuration FileConfluence's logging behaviour is defined in the following properties file: This file is a standard log4j configuration file, as described in the Apache log4j documentation. Finding the Confluence Log FilesThis section describes Confluence's default logging behaviour, assuming that you have not changed the destination of the logs. For Confluence 2.6.x and earlier, the default behaviour is:
For Confluence 2.7.x and later, both Standalone and EAR/WAR editions follow the same default behaviour:
Changing the Destination of the Log FilesTerminology: In log4j, an output destination is called an 'appender'. To change the destination of the log files, you need to stop Confluence and then change the settings in the 'Logging Location and Appender' section of the log4j.properties file. The location of this file is described above. In the standard properties file supplied with Confluence 2.7 and later, you will find entries for two appenders:
Confluence ships with the full suite of appenders offered by log4j. Read more about appenders in the log4j documentation. Changing the Logging LevelsWe recommend that you configure Confluence's logging to your own requirements. You can change the log settings in two ways:
Both methods are described below. Terminology: In log4j, a 'logger' is a named entity. Logger names are case-sensitive and they follow a hierarchical naming standard. For example, the logger named com.foo is a parent of the logger named com.foo.Bar. Editing the Properties FileTo configure the logging levels and other settings on a permanent basis, you need to stop Confluence and then change the settings in the log4j.properties file, described above. The properties file contains a number of entries for different loggers that can be uncommented if you are interested in logging from particular components. Read more in the Apache log4j documentation. Below are some guidelines on specific configuration options you may find useful. Changing the Logging Levels at RuntimeFrom Confluence 2.7, you can change some of Confluence's logging behaviour via the Administration Console while Confluence is running. Any changes made in this way will apply only to the currently-running Confluence lifetime. The changes are not written to the log4j.properties file and are therefore discarded when you next stop Confluence.
The 'Logging and Profiling' screen shows a list of all currently defined loggers. On this screen you can:
To change the log levels at runtime,
Using Some Specific Confluence Logging OptionsThis section contains some pointers to specific log configurations you may need. Log the Details of SQL Requests made to the DatabaseYou may want to increase Confluence's logging so that it records individual SQL requests sent to the database. This is useful for troubleshooting specific problems. You can enable detailed SQL logging in two ways:
Log the Details of Users Viewing/Accessing each Confluence PageYou can configure the log to show which users are accessing which pages in Confluence. This can only be done via the logging properties file – see the detailed instructions. RELATED TOPICS
|
![]() |
Document generated by Confluence on Aug 07, 2008 19:05 |