Change logging levels in Jira deployed on kubernetes permanently

robotsnoindex

Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

In order to change logging levels in Jira permanently, log4j configuration file needs to be modified. Using the Atlassian helm charts, it is possible to deploy a modified version of these files. 

Environment

Jira running on kubernetes deployed using Atlassian Helm charts.

Solution

A configmap is needed to store the customized log4j.properties file and mount it to the correct path. You can use the following steps to perform this change.

  1. Capture the existing log4j.properties file from a running pod.

    #Version 9.4 and earlier
    $ kubectl cp jira-0:/opt/atlassian/jira/atlassian-jira/WEB-INF/classes/log4j.properties log4j.properties -c jira
    
    #Version 9.5 or newer
    $ kubectl cp jira-0:/opt/atlassian/jira/atlassian-jira/WEB-INF/classes/log4j2.xml log4j2.xml -c jira
  2. Modify log4j.properties file according to Change logging levels in Jira Server
  3. Create a new configmap of the configuration file

    #Version 9.4 and earlier
    $ kubectl create configmap log4j --from-file=log4j.properties -o yaml --dry-run=client | kubectl apply -f -
    
    #Version 9.5 or newer
    $ kubectl create configmap log4j --from-file=log4j2.xml -o yaml --dry-run=client | kubectl apply -f -
  4. Modify values.yaml file used in the helm deployment

    #Version 9.4 and earlier
    additionalFiles: 
      - name: log4j
        type: configMap
        key: log4j.properties
        mountPath:  /opt/atlassian/jira/atlassian-jira/WEB-INF/classes
    
    #Version 9.5 or newer
    additionalFiles: 
      - name: log4j
        type: configMap
        key: log4j2.xml
        mountPath:  /opt/atlassian/jira/atlassian-jira/WEB-INF/classes
  5. Run helm upgrade to make the changes in the runtime

    $ helm upgrade <release-name> atlassian-data-center/jira --values values.yaml




Last modified on Mar 7, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.