Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2015 09:24:42 +0000
From:      Matt Smith <fbsd@xtaz.co.uk>
To:        Jim Pazarena <fquest@paz.bz>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: dhcpd logging
Message-ID:  <20150327092442.GB51823@xtaz.uk>
In-Reply-To: <55144D86.2080105@paz.bz>
References:  <55144D86.2080105@paz.bz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 26 11:18, Jim Pazarena wrote:
>I want to place dhcpd log messages in a file rather than the
>syslog facility LOG_DAEMON.
>So I see that with the command line flag "-d" I can direct messages
>to stderr.
>
>How can I adjust the normal rc.conf to actually TELL the system
>the file name? Is there a way? Also, I would want to append to the
>file via ">>" rather than clobber it every time I reload dhcpd.
>

As Ben said in the other reply. Why not just use syslog? I do this in 
/etc/syslog.conf:

At the top of the file above all the other lines:
!-dhcpd

...

At the bottom of the file below all the other lines:
!dhcpd
*.*                                             /var/log/dhcpd.log
!*

This will cause all log lines from dhcpd to go to that file and remove 
them from all of the other files.

And then something like this in /etc/newsyslog.conf:

/var/log/dhcpd.log                                      640 3 * $W6D0

Which will rotate it every week.

-- 
Matt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150327092442.GB51823>