Wednesday, August 26, 2009

stop cron from logging to syslog

If this is annoying to you every 5 minutes (for example with cacti)

localhost cron[23731]:(cactiuser) CMD (php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1)

localhost cron[28722]:(cactiuser) CMD (php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1)

localhost cron[28723]:(root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

in /etc/syslog-ng/syslog-ng.conf add:
filter f_croninfo { level(info) and not facility(cron); };

and modified the logging lines:
log { source(src); filter(f_croninfo); destination(serial_console); };
log { source(src); filter(f_croninfo); destination(messages); };