catalina.out rolling with Tomcat 6.0

后端 未结 5 2122
囚心锁ツ
囚心锁ツ 2020-12-01 00:16

I have a default tomcat installation with no change to the logging configuration. The log files (in particular catalina.out) appear to be getting rolled (daily) correctly.

5条回答
  •  醉梦人生
    2020-12-01 00:58

    I also noticed my tomcat log folder (/usr/local/tomcat/logs) was quite huge. To check the size of the log folder do the following du -hs /usr/local/tomcat/logs/. To resolved this issue by setting up a cron that would clean the files every night or you can run these commands manually. Here is the shell script that would delete files which are 5 days older

    #!/bin/sh
    find /usr/local/tomcat/logs -name 'catalina.*.log' -mtime +5 -print0 | xargs -0 rm -f
    find /usr/local/tomcat/logs -name 'localhost_access_log.*.txt' -mtime +5 -print0 | xargs -0 rm -f
    

提交回复
热议问题