進入/etc/logrotate.d目錄建立tomcat文件,內容以下:java
/usr/local/java/tomcat7/logs/catalina.out {node
dailylinux
rotate 15tomcat
missingokide
notifemptypost
copytruncaterest
compress日誌
nodelaycompressip
sharedscriptsit
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
linux日誌分隔
/etc/init.d/rsyslog restart