Cleaning up logs in Jira and Confluence

I would like to cleanup the log files in /opt/atlassian/(jira|confluence)/logs/. I have enabled logrotate, but tomcat is creating dated log files, ie catalina.2017-03-27.log, which defeats logrotate. I have foud where to disabled rotation for the access log in the server.xml file, but I can't find where to do this for catalina.out.

I would like to either disable the tomcat rotation so that logrotate can manage the logs or if it makes more sense, set a limit to how many logs tomcat keeps. Can someone please point me to where this is configured and what options there are specific to rotation or a link to where this is documented? The Configuring Logging section only includes info on enabling/disabling and levels from what I can see. I did not see anything for rotation.

2 answers

So I ended up doing as errno suggested since even Jira support seems to be unaware of this behavior and just keeps referencing back to their broken documentation. I wrote a script that deletes access.log.* and *.log files with a modified date of more than 30 days. I'll just check after an upgrade to make sure this behavior hasn't changed again. 

If it helps anyone, the command that is run is:

find /opt/atlassian/jira/logs/ -maxdepth 1 -name "*.log" -mtime +30 -exec rm {} \;

0 vote
Andrei [errno] Community Champion Apr 12, 2017

we just added a cron.weekly entry to clean-up the directory (a simple shell script). works well and has a benefit of being pushed into our code repo...

I would like to avoid writing another script to clean up when there are already tools to do this, but thank you for the suggestion.

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 ...

3,331 views 14 20
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