วันพุธที่ 27 ตุลาคม พ.ศ. 2553

split /var/log/message log

I'm using gentoo and vixie-cron as a system cron. After using it for a while, I found that gentoo store cron log in to /var/log/message. And, I just kind of like to split this for monitoring easily. Here is what I have done.

edit this :
/etc/syslog-ng/syslog-ng.conf

add the following lines :
filter f_cron { facility (cron); };
destination cron { file("/var/log/cron.log"); };
log { source(src); filter(f_cron); destination(cron); };

reload syslog-ng :
/etc/init.d/syslog-ng reload

you may need to setting the logrotate. Please see the example in /etc/logrotate.d/ for example

ไม่มีความคิดเห็น:

แสดงความคิดเห็น