Subject: Re: Getting to grips with syslog and localn.*
To: Amadeus Stevenson <amadeus.stevenson@gmail.com>
From: Pavel Cahyna <pavel@netbsd.org>
List: netbsd-help
Date: 04/29/2006 19:10:12
On Sat, Apr 29, 2006 at 10:17:51AM +0100, Amadeus Stevenson wrote:
> Hello,
> 
> I've got a few access point logs attached to my netbsd syslogd, and
> after searching the internet and reading the man pages am no closer to
> understanding how to separate their messages from /var/log/messages
> into something else:

You want the syslogd from (at least) NetBSD 3. It is much improved.

Probably you can do "cvs up -dP -rHEAD" in src/usr.sbin/syslogd and
compile it and install it over the old syslogd, if you don't want to
upgrade.

> I'd like to do the same for dhclient logs as well, but don't know how
> to divert the dhclient log messages into a file eg.
> /var/log/dhclient.log. The same goes for named logs (bind9).

The new syslogd can filter according to the program name.

> Also, all my access points are filling up /var/log/messages nicely,
> but I'd far prefer to have them log to a separate file. Their entry is
> similar to:
> 
> Apr 29 10:13:23 xxx.xxx.xxx.xx2 Associated:  00-11-50-BB-C8-E2 st=0^M
> Apr 29 10:13:47 xxx.xxx.xxx.xx2 Disassociated:  00-11-50-BB-C8-E2^M

It can also filter according to the host name.

> How do I "find out" what facility corresponds to my access point
> messages, named and dhclient? (Also stripping the ^M character would
> be handy too).

It also has a -vv flag, which tells it to log the priority and facility so
you can find it out.

I am afraid that it won't help you with the ^M character...

(Thanks to Jason Thorpe who ported those much welcome improvements from
FreeBSD.)

Pavel