пятница, 1 мая 2009 г.

Конфиг syslog-ng

Pptp засоряет системный лог тупыми сообщениями о пропавших пакетах. Из-за этого /var/log/messages очень быстро разрастается. Направил сообщения от pptp в другой лог с помощью syslog-ng. Мой конфиг syslog-ng:
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.conf.gentoo,v 1.7 2007/08/02 04:52:18 mr_bones_ Exp $
#
# Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett

options {
chain_hostnames(off);
sync(0);

# The default action of syslog-ng 1.6.0 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(43200);
};

source src {
unix-stream("/dev/log" max-connections(256));
internal();
file("/proc/kmsg");
};

destination messages { file("/var/log/messages"); };
destination pptplog { file("/var/log/pptp.log"); };
destination authlog { file("/var/log/auth.log"); };

# 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"); };

filter f_authpriv { facility(auth, authpriv); };
filter f_pptp { match("pptp"); };
filter f_messages { level(info..warn) and not match("pptp") and not facility(auth, authpriv); };

log { source(src); filter(f_messages); destination(messages); };
log { source(src); filter(f_pptp); destination(pptplog); };
log { source(src); filter(f_authpriv); destination(authlog); };
log { source(src); destination(console_all); };

Комментариев нет:

Отправить комментарий