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

This widget could not be displayed.

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

This widget could not be displayed.
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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

97 views 1 0
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