Configuring Logging

We recommend that you configure Confluence's logging to your own requirements. You can change the log settings in two ways:

  • Configure logging in Confluence Administration – Your changes will be in effect only until you next restart Confluence.
  • Edit the properties file – Your changes will take effect next time you start Confluence, and for all subsequent sessions.

Both methods are described below. In some rare circumstances you may also need to configure the logging.properties file.

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.

Configure logging in Confluence Administration

You can change some of Confluence's logging behavior 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.

Not all logging behavior can be changed via the Administration Console. For logging configuration not mentioned below, you will need to stop Confluence and then edit the logging properties file instead.

The 'Logging and Profiling' screen shows a list of all currently defined loggers. On this screen you can:

  • Turn page profiling on or off.
  • Turn detailed SQL logging on or off.
  • Add a new logger for a class/package name.
  • Remove a logger for a class/package name.
  • Set the logging level (INFO, WARN, FATAL, ERROR or DEBUG) for each class or package name.
  • Reset all logging levels to a predefined profile.
Changing the logging configuration
  1. Choose the cog icon , then choose General Configuration under Confluence Administration
  2. Select 'Logging and Profiling' in the 'Administration' section of the left-hand panel.
    (Info) You need to have System Administrator permissions in order to perform this function.
  3. The 'Logging and Profiling' screen appears, as shown below. Use the following guidelines to change the logging behavior while Confluence is running:
    • 'Performance Profiling' — See Page Request Profiling.
    • 'SQL Logging' — Click the 'Enable SQL Logging' button to log the details of SQL requests made to the database.
      (Info) If you need to enable logging of SQL parameter values, you will need to change the setting in the properties file. This option is not available via the Administration Console.
    • 'Log4j Logging' — Click one of the profile buttons to reset all your loggers to the predefined profiles:
      • The 'Production' profile is a fairly standard profile, recommended for normal production conditions.
      • The 'Diagnostic' profile gives more information, useful for troubleshooting and debugging. It results in slower performance and fills the log files more quickly.
    • 'Add New Entry' — Type a class or package name into the text box and click the 'Add Entry' button. The new logger will appear in the list of 'Existing Levels' in the lower part of the screen.
    • 'Existing Levels' - These are the loggers currently in action for your Confluence instance.
      • You can change the logging level by selecting a value from the 'New Level' dropdown list. Read the Apache documentation for a definition of each level.
      • Click the 'Remove' link to stop logging for the selected class/package name.
  4. Click the 'Save' button to save any changes you have made in the 'Existing Levels' section.

Screenshot: Changing Log Levels and Profiling
 

Editing the Properties File

To 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.

See Working with Confluence Logs for some guidelines on specific configuration options you may find useful.

Configuring Levels for java.util.logging in logging.properties

A few libraries used by Confluence use java.util.logging rather than log4j or slf4j. These libraries include:

  • com.sun.jersey
  • org.apache.shindig
  • net.sf.ehcache

Confluence's logging.properties file is set to redirect java.util.logging at specific levels to log4j via slf4j.

To increase logging levels for these libraries you must first configure the logging.properties file in <CONFLUENCE-INSTALL>/confluence/WEB-INF/classes/. The logging levels are different from log4j and are listed here.
For example, to increase logging for shindig change the following line in the logging.properties file:

org.apache.shindig.level = INFO

to

org.apache.shindig.level = FINE

And then use one of the methods above as well to configure the log4j level.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport