Catalina Logs are not Rotated or Removed
catalina.outis not rotated
catalina.*.logfiles are not removed
These log files can grow large in size.
Confluence uses Tomcat's default logging configuration. This configuration means:
catalina.outgets all output from stdout and stderr via ConsoleHandler, and also logs from bootstrap step when you start or stop Confluence
catalina.outis never rotated
catalina.YYYY-MM-DD.logcontains the output from stdout and stderr via FileHandler, but not the bootstrap logs
catalina.YYYY-MM-DD.logfiles are created on the first log event of that date, or when the Tomcat server starts. This means that if there is no log for that date, and the server was not started on that date, then the file is never created.
catalina.outfiles are not removed
host-managerlogs are configured similarly to
Reduce the amount logged to
catalina.out, by disabling the ConsoleHandler. This is done by modifying the conf/logging.properties file. Find the line that looks like this:conf/logging.properties
.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler
Change it to look like this:conf/logging.properties
.handlers = 1catalina.org.apache.juli.AsyncFileHandler
This will reduce the amount of logging to
catalina.out, and does not lose any logging, since all of this output is already being put into the *.log files.
Set up a scheduled job, using cron or some alternative, which removes old log files. For example to remove all the files older than one week, a script like this should do the job:sample_catalina_log_clean.sh
#!/bin/sh find $CONFLUENCE_INSTALL/logs -name 'catalina.*.log' -mtime +1w -print0 | xargs -0 rm -f
Remember to replace $CONFLUENCE_INSTALL with your actual Confluence install path, and to test your script on sample data to make sure you don't accidentally delete any logs that you want to keep.
The script above is just a suggestion. It's possible to use some other removal or archiving method if desired.