Gentoo Archives: gentoo-user

From: Michael Orlitzky <mjo@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] syslog-ng configs for separating warnings/errors and different types of traffic
Date: Sun, 22 Dec 2013 23:35:46
Message-Id: 52B7773E.4090107@gentoo.org
In Reply to: [gentoo-user] syslog-ng configs for separating warnings/errors and different types of traffic by Tanstaafl
1 On 12/22/2013 03:17 PM, Tanstaafl wrote:
2 >
3 > I'd still like everything to go to /var/log/messages, but I'd like to
4 > also send certain types of messages to different logs to simplify
5 > troubleshooting, etc - ie, I often peruse the logs with:
6 >
7 > egrep '(reject|warning|error|fatal|panic):' /var/log/messages
8 >
9 > But I'd like to actually feed all of those messages to a separate log,
10 > for easier tailing.
11
12 For each separate log you want, you'll need a destination/filter pair,
13 and you'll have to tie them together with a "log" directive. For example,
14
15 destination warnlog { file("/var/log/warn.log"); };
16 filter f_warn { level(warn); };
17 log { source(src); filter(f_warn); destination(warnlog); };