Working with Confluence Logs
Confluence uses Apache's log4j logging service. This allows administrators to control the logging behavior and the log output file by editing a configuration file. There are six log4j logging levels.
If you request help from Atlassian Support, we will almost always ask for the Confluence application logs. The easiest way to get these logs is to go to > General Configuration > Troubleshooting and support tools and follow the prompts to create a Support Zip.
On this page:
Related pages:
Finding the Confluence log files
This section describes Confluence's default logging behavior, and assumes that you have not changed the destination of the logs. In order to unify logging across different application servers, Confluence uses the atlassian-confluence.log
as its primary log, not the application server log.
- When you start Confluence, log entries will be sent to the application server logs until Confluence has completed its initial bootstrap. Any log entries written to the console will be repeated into the log in the Confluence home directory as described below.
- Once the initial startup sequence is complete, all logging will be to
<confluence-home>/logs/atlassian-confluence.log
. For example:c:/confluence/data/logs/atlassian-confluence.log
.
Note that the default location is the Confluence home directory, not the application server's log file. The home directory is specified in <confluence-installation>/confluence/WEB-INF/classes/confluence-init.properties
.
Finding the log configuration file
The logging behavior for Confluence and Synchrony is defined in the following properties file:
<CONFLUENCE-INSTALL>/confluence/WEB-INF/classes/log4j.properties
This file is a standard log4j configuration file, as described in the Apache log4j documentation.
Changing the destination of the log files
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, you will find entries for two appenders:
com.atlassian.confluence.logging.ConfluenceHomeLogAppender
– This is a custom appender which controls the default logging destination described above. This appender allows the following settings:- MaxFileSize
- MaxBackupIndex
org.apache.log4j.RollingFileAppender
– If you want to log to a different location, uncomment theRollingFileAppender
line and change the destination file in the line below it. Comment out the previous lines referring to theConfluenceHomeLogAppender
.
The Synchrony log destination can also be changed in the same way in file.
Confluence ships with the full suite of appenders offered by log4j. Read more about appenders in the log4j documentation.
For more detailed information see Configuring log4j in Confluence to send specific entries to a different log file in our Knowledge Base.
Changing the size and number of log files
By default, Confluence keeps 5 log files, which are overwritten as they reach 20 MB.
You can change the default log size and the number of log files to keep by editing the following values in <CONFLUENCE-INSTALL>/confluence/WEB-INF/classes/log4j.properties
file.
log4j.appender.confluencelog.MaxFileSize=20480KB
log4j.appender.confluencelog.MaxBackupIndex=5
Changing the logging levels
See Configuring Logging for instructions on how to change the logging configuration of Confluence.
Specific Confluence logging options
Here's some specific log configurations you may need when troubleshooting.
Log the details of SQL requests made to the database
You 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:
- At runtime – see instructions above.
- Via the logging properties file – see the detailed instructions.
Log the details of users viewing/accessing each Confluence page
You 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.
Scanning log files for known problems
Atlassian Troubleshooting and support tools includes a log analyzer that can check for you Confluence logs for errors and match them against known problems in our knowledge base and issue tracker.
See Troubleshooting Problems and Requesting Technical Support to find out how to set up a periodic scan of your log files.