Linux system uses logrotate to cut Tomcat logs

  
                

The operation of the log under the Linux system mainly includes dumping, mailing, and compression. If it is manually operated, it will be very troublesome. However, there are tools to help users handle the logs. This article will teach you how to use the logrotate to cut the Tomcat log in the Linux system.

on the Tomcat log log cutting catalina.out follows

# ls -lh /usr/local/tomcat/logs/catalina.out

-rw-r --r-- 1 www www 14M Aug 28 15:55 /usr/local/tomcat/logs/catalina.out

Configuring logrotate to cut catalina.out logs

# cat /etc /logrotate.d/tomcat

/usr/local/tomcat/logs/catalina.out {

daily

rotate 5

missingok

dateext

compress

notifempty

copytruncate

} Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved