How to delete Tomcat Access Log after n days?

后端 未结 6 1768
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 19:48

I only would like to keep the Access Logs of the last n days created by Tomcat Access Log Valve. http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access%20Log%20Val

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-03 20:46

    By default rotatable is true for Access Log, so you will be having a new file created every 24 hours.

    Tomcat itself does not do any housekeeping on the old files, the general principle on a Unix system is to have a cron job set up on the system to archive older files into a back up directory and/or delete them.

提交回复
热议问题