We have Solr running on Tomcat 8. We are having issues in our different environments with localhost_access_log files filling up the servers. These files are created by the Access Valve Log in server.xml configured like this -
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log"
suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
From what I've read, there is no OOTB way in Tomcat to clean up old log files. What can I implement to clean up the old access log files?
You can disable localhost_access log by commenting configuration line.
or
In linux, set daily cron job to delete old files.
cleanup.sh
You can have a log rotation and then choose what logs files to delete
As rotation is set to true by default you should already have it. Then you can for exemple delete logs older than 5 days:
To delete log files older than 10 days the following commands can be used.