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 {} \;

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 Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,008 views 4 9
Read article

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