Jira Log Rotation

How does JIRA log rotation work? I can see our logs in /install directory/jira/logs are beign rolled over once a day but I want to also compress an donly keep so many. There is nothign in /etc/logrotate.d for JIRA logs so I'm not sure where/what is doing it.

Any ideas?

3 answers

1 accepted

I've created a cron to auto delte any logs older then 30 days.

30 2 * * * find /opt/atlassian/jira/logs/*.* -mtime +30 | xargs rm

Hi Brandon,

I've been investigating this same issue as well.

The logs in JIRA's Installation directory are the Tomcat log files, which are not rotated/expired automatically.

The logs in JIRA's Home directory are the Atlassian log files, which are rotated at around 20MB.

My catalina.out log file (in the Installation log directory) at one point was up to 8GB in size. Other log files here weren't as large but dated back years.

Following these links:

I was able to come-up with a log rotation/expiration solution that works:

(Note: The path to your installation directory and log4j.properties may be different than mine)

  1. I edited the <tt>/usr/local/atlassian/jira/atlassian-jira/WEB-INF/classes/log4j.properties</tt> file and removed console logging from the various logging categories:
    sed -i 's/, console,/,/g' log4j.properties
  2. This got rid of the majority of logging from <tt>/usr/local/atlassian/jira/logs/catalina.out</tt>
  3. But there is still some logging when tomcat processes start in catalina.out so I need to rotate/expire this log file. We can use logrotate for this - here is the config I used in /etc/logrotate.d/atlassian:
    /usr/local/atlassian/jira/logs/catalina.out {
    	rotate 6
  4. I'm not sure if you're using Confluence as well. If so, you'll want to set-up log rotation for its catalina.out file as well. I didn't have to modify its log4j.properties file to remove console logging though.
  5. Next you'll want to come up with a scheme for expiring all of the other Tomcat log files. I wrote a script for that runs as a cron job nightly that removes files after they reach an age of my choosing. I'm happy to provide my script to you if you necessary.

Hope this helps get you going in the right direction. Le me know if you have questions.

-- Stephen

1 votes
Pedro Souza Atlassian Team Aug 07, 2014

Hey Brandon.

I don't think it's possible to compress the logs automatically, without using a third-party script or tools.

I would like to send you some pages that may give you a better idea, on how the logging works:





Please, see this another question regarding auto compress the rotated logs:


I hope it helps.


Pedro Souza.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,888 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot