进入/etc/logrotate.d目录创建tomcat文件,内容如下:
/usr/local/java/tomcat7/logs/catalina.out {
daily
rotate 15
missingok
notifempty
copytruncate
compress
nodelaycompress
sharedscripts
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
时间: 2024-10-09 17:19:11