Subject: Re: Getting to grips with syslog and localn.*
To: Amadeus Stevenson <amadeus.stevenson@gmail.com>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 04/29/2006 07:46:08
> I managed some time ago to separate out dhcpd logs (although how I
> knew it was local7 is a mystery).

dhcpd(8) man page says LOG_DAEMON. You probably based your configuration 
on the example which has:

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

> 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).

Some implementations of syslogd can do this for specific processes (and 
even hostnames). I have used this a lot of FreeBSD.

It is not available in NetBSD 2.x. But now I see it is in NetBSD 3. The 
cvs commit says "Extend the syntax of syslog.conf to allow selections of 
log destinations by comma-separated lists of program name (including 
kernel-generated messages) and originating host name." (and more).

Here is an untested example to put at very bottom of your syslog.conf:

!dhclient
*.*		/var/log/dhclient.log
!*

The last line above is not needed if you don't have any later rules.

> How do I "find out" what facility corresponds to my access point
> messages, named and dhclient?

NetBSD 3 has that too. This is an untested example:

+host1
*.*	/var/log/host1.logs
+host2
*.*	/var/log/host2.logs
+*

(Last line not needed if at end.)

More details in NetBSD 3 (or later) syslog.conf manual page.

Have fun!

 Jeremy C. Reed

p.s. Thank you thorpej for adding all these features!