We have an application server that uses a minimal config for log4j to rotate files. The rest (due to political reasons) needs to be handled otherwise.
I'm running into a problem with logrotate, in that I end up with several *.gz.gz.gz files. Each file is logged in a custom format, like:
appsvr.log.2010-02
It's not enough to put *.log in the logrotate config, and * has negative results.
So my question is how to get around this -- should I put in a regex in the logrotate configuration? (if it would support it) Here's what we have:
/usr/tomcat/logs/* /usr/tomcat/appsvr_logs/* {
rotate 5
missingok
compress
notifempty
size 10M
sharedscripts
prerotate
/sbin/service tomcat5 stop
sleep 7
endscript
postrotate
/sbin/service tomcat5 start
endscript
}
Obviously the * is incorrect - and that's my bad. It was previously *.log which wasn't picking up the above-mentioned filenames and thus nothing was being rotated.
I otherwise end up with incidents like the other day where we have a full filesystem because the logs were never rotated. I know I could run a simple "find" but that negates the point of having logrotate.
Thanks.
I'm running into a problem with logrotate, in that I end up with several *.gz.gz.gz files. Each file is logged in a custom format, like:
appsvr.log.2010-02
It's not enough to put *.log in the logrotate config, and * has negative results.
So my question is how to get around this -- should I put in a regex in the logrotate configuration? (if it would support it) Here's what we have:
/usr/tomcat/logs/* /usr/tomcat/appsvr_logs/* {
rotate 5
missingok
compress
notifempty
size 10M
sharedscripts
prerotate
/sbin/service tomcat5 stop
sleep 7
endscript
postrotate
/sbin/service tomcat5 start
endscript
}
Obviously the * is incorrect - and that's my bad. It was previously *.log which wasn't picking up the above-mentioned filenames and thus nothing was being rotated.
I otherwise end up with incidents like the other day where we have a full filesystem because the logs were never rotated. I know I could run a simple "find" but that negates the point of having logrotate.
Thanks.