Change logging levels in Jira deployed on kubernetes permanently
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.
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
- Modify log4j.properties file according to Change logging levels in Jira Server
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 -
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
Run helm upgrade to make the changes in the runtime
$ helm upgrade <release-name> atlassian-data-center/jira --values values.yaml