View previous topic :: View next topic |
Author |
Message |
Cr0t l33t
Joined: 27 Apr 2002 Posts: 944 Location: USA
|
Posted: Wed Jul 24, 2013 5:44 pm Post subject: logs to /var/log/messages and /var/log/cron.log |
|
|
I am trying to filter out all the cron messages to /var/log/cron.log, but it ends up in /var/log/messages AND /var/log/cron.log. This used to work just fine, but with the latest update of syslog-ng this has been failing. Code: | @version: 3.4
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/3.4/syslog-ng.conf.gentoo,v 1.2 2013/06/02 01:18:35 mr_bones_ Exp $
#
# Syslog-ng default configuration file for Gentoo Linux
# https://bugs.gentoo.org/show_bug.cgi?id=426814
@include "scl.conf"
options {
threaded(yes);
chain_hostnames(no);
# The default action of syslog-ng is to log a STATS line
# to the file every 10 minutes. That's pretty ugly after a while.
# Change it to every 12 hours so you get a nice daily update of
# how many messages syslog-ng missed (0).
stats_freq(43200);
# The default action of syslog-ng is to log a MARK line
# to the file every 20 minutes. That's seems high for most
# people so turn it down to once an hour. Set it to zero
# if you don't want the functionality at all.
mark_freq(3600);
};
source src { system(); internal(); };
destination messages { file("/var/log/messages"); };
destination cron { file("/var/log/cron.log"); };
destination ppp { file("/var/log/ppp.log"); };
filter f_cron { facility(cron); };
filter f_ppp { program(ppp); };
filter f_pptp { program(pptp); };
filter f_messages { level(info..warn)
and not facility(cron, local2); };
# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
# ...if you intend to use /dev/console for programs like xconsole
# you can comment out the destination line above that references /dev/tty12
# and uncomment the line below.
#destination console_all { file("/dev/console"); };
log { source(src); destination(messages); };
log { source(src); destination(console_all); };
log { source(src); filter(f_cron); destination(cron); flags(final);};
log { source(src); filter(f_ppp); destination(ppp); flags(final);};
log { source(src); filter(f_pptp); destination(ppp); flags(final);}; |
_________________ cya |
|
Back to top |
|
|
Cr0t l33t
Joined: 27 Apr 2002 Posts: 944 Location: USA
|
Posted: Wed Jul 24, 2013 6:41 pm Post subject: |
|
|
FIXED: Apparently the order matters... Code: | @version: 3.4
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/3.4/syslog-ng.conf.gentoo,v 1.2 2013/06/02 01:18:35 mr_bones_ Exp $
#
# Syslog-ng default configuration file for Gentoo Linux
# https://bugs.gentoo.org/show_bug.cgi?id=426814
@include "scl.conf"
options {
threaded(yes);
chain_hostnames(no);
# The default action of syslog-ng is to log a STATS line
# to the file every 10 minutes. That's pretty ugly after a while.
# Change it to every 12 hours so you get a nice daily update of
# how many messages syslog-ng missed (0).
stats_freq(43200);
# The default action of syslog-ng is to log a MARK line
# to the file every 20 minutes. That's seems high for most
# people so turn it down to once an hour. Set it to zero
# if you don't want the functionality at all.
mark_freq(3600);
};
source src { system(); internal(); };
destination messages { file("/var/log/messages"); };
destination cron { file("/var/log/cron.log"); };
destination ppp { file("/var/log/ppp.log"); };
filter f_cron { facility(cron); };
filter f_ppp { program(ppp); };
filter f_pptp { program(pptp); };
filter f_messages { level(info..warn)
and not facility(cron, local2); };
# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
# ...if you intend to use /dev/console for programs like xconsole
# you can comment out the destination line above that references /dev/tty12
# and uncomment the line below.
#destination console_all { file("/dev/console"); };
log { source(src); filter(f_cron); destination(cron); flags(final); };
log { source(src); filter(f_ppp); destination(ppp); flags(final);};
log { source(src); filter(f_pptp); destination(ppp); flags(final);};
log { source(src); destination(messages); };
log { source(src); destination(console_all); }; |
_________________ cya |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|