Logging and Profiling

Logging

JIRA uses a powerful logging module called log4j for runtime logging.

Log file location

The logs are written to the log subdirectory of your JIRA Home Directory (or elsewhere if you have configured a different location). You can view the location of the atlassian-jira.log in the 'File Paths' section of the System Information page.
  • Security-related information (e.g. login, logout, session creation/destruction, security denials) is written to atlassian-jira-security.log.

Changing the location of the log

In the log4j.properties file (located in the JIRA Installation Directory):

  1. Change the following line:

    log4j.appender.filelog=com.atlassian.jira.logging.JiraHomeAppender
    

    ...to this:

    log4j.appender.filelog=org.apache.log4j.RollingFileAppender
    
  2. Change the following line to point to the new location of the log file:

    log4j.appender.filelog.File=atlassian-jira.log
    

On this page:

Logging levels

There are five logging levels available in log4j: 'DEBUG', 'INFO', 'WARN', 'ERROR' and 'FATAL'. Each logging level provides more logging information that the level before it:

  • 'DEBUG'
  • 'INFO'
  • 'WARN'
  • 'ERROR'
  • 'FATAL'

'DEBUG' provides the most verbose logging and 'FATAL' provides the least verbose logging. The default level is WARN, meaning warnings and errors are displayed. Sometimes it is useful to adjust this level to see more detail.
(warning) Please be aware: the 'DEBUG' setting may cause user passwords to be logged.

The default logging levels can be changed either

  • temporarily — your change to the logging level will not persist after you next restart JIRA, or
  • permanently — your change to the logging level will persist, even after you restart JIRA.

For example, when troubleshooting, you might temporarily change the logging level from 'WARNING' to 'INFO' so as to get a more detailed error message or a stack trace. If you are unsure of which logging categories to adjust, the most helpful information generally comes from the log4j.rootLogger category and the log4j<category>.com.atlassian categories.

Temporarily changing the logging level

  1. Log in as a user with the 'JIRA System Administrators' global permission.
  2. Choose > System. Select Troubleshooting and Support > Logging & Profiling to open the Logging page, which lists all defined log4j categories (as package names) and their current logging levels.
    (tick) Keyboard shortcut: 'g' + 'g' + start typing 'logging & profiling'
  3. To change logging level of a category, click linked logging level associated with the relevant package name. To turn off logging of a category, click the 'OFF' link associated with the relevant package name.

Permanently changing the logging level

  1. Edit the log4j.properties file (located in the JIRA Installation Directory).
  2. Locate the section:

    log4j.logger.com.atlassian = WARN, console, filelog
    log4j.additivity.com.atlassian = false
    

    and make your desired changes (e.g. change the WARN to DEBUG).
    (info) The log4j.properties file that ships with JIRA has the default logging levels specified. For more information about log4j (e.g. how to define new logging categories), and about the format of the log4j.properties file, please refer to the documentation on the log4j site.

  3. (Only if you are running JIRA WAR) Rebuild and redeploy the web application.
  4. Restart JIRA.

(info) Please Note: If your application server configures logging itself, you may need to remove the log4j.properties file. You may also need to remove the entire log4j.jar file to get logging to work.

Profiling

If you are experiencing performance issues with JIRA, it is often helpful to see where the slow-downs occur. To do this you can enable profiling as described below, and then analyse the performance traces that JIRA will produce for every request. An example of a profiling trace is shown below:

[Filter: profiling] Turning filter on [jira_profile=on]
[116ms] - /secure/Dashboard.jspa
  [5ms] - IssueManager.execute()
    [5ms] - IssueManager.execute()
      [5ms] - Searching Issues
  [29ms] - IssueManager.execute()
    [29ms] - IssueManager.execute()
      [29ms] - Searching Issues
        [28ms] - Lucene Query
          [23ms] - Lucene Search

Profiling can be enabled either

  • temporarily — profiling will be enabled until you next restart JIRA, or
  • permanently — profiling will remain enabled, even after you restart JIRA.

Temporarily enabling profiling

  1. Log in as a user with the 'JIRA System Administrators' global permission.
  2. Choose > System. Select Troubleshooting and Support > Logging & Profiling to open the Logging page, which lists all defined log4j categories (as package names) and their current logging levels.
    (tick) Keyboard shortcut: 'g' + 'g' + start typing 'logging & profiling'
  3. Scroll to the 'Profiling'section at the end of the page. This section will inform you whether profiling is currently turned 'ON' or 'OFF' and will provide you with 'Disable' or 'Enable' profiling links respectively.
    • To turn Profiling 'ON', click the 'Enable profiling' link. JIRA will start generating profiling traces in its log.
    • To turn Profiling 'OFF', click the 'Disable profiling' link.

Permanently enabling profiling

  1. In your JIRA installation directory, edit either the atlassian-jira/WEB-INF/web.xml file (or if you are using the JIRA WAR distribution, the webapp/WEB-INF/web.xml file).
  2. Find the following entry:

            <filter>
                <filter-name>profiling</filter-name>
                <filter-class>com.atlassian.jira.web.filters.JIRAProfilingFilter</filter-class>
                <init-param>
                    <!-- specify the which HTTP parameter to use to turn the filter on or off -->
                    <!-- if not specified - defaults to "profile.filter" -->
                    <param-name>activate.param</param-name>
                    <param-value>jira_profile</param-value>
                </init-param>
                <init-param>
                    <!-- specify the whether to start the filter automatically -->
                    <!-- if not specified - defaults to "true" -->
                    <param-name>autostart</param-name>
                    <param-value>false</param-value>
                </init-param>
            </filter>
    
  3. Modify the autostart parameter to be true instead of false.That is:

                <init-param>
                    <!-- specify the whether to start the filter automatically -->
                    <!-- if not specified - defaults to "true" -->
                    <param-name>autostart</param-name>
                    <param-value>true</param-value>
                </init-param>
    
  4. Save the file. Profiling will be enabled when you restart JIRA.
    (info) If you are running JIRA WAR, re-build and re-deploy the JIRA web application using the build script and the instructions for your application server (i.e. Apache Tomcat).

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