[Dnsmasq-discuss] Patch to change dnsmasq logentries

Simon Kelley simon at thekelleys.org.uk
Fri Feb 27 19:48:58 GMT 2009


Carlos Carvalho wrote:
> Olaf Westrik (weizen_42 at ipcop-forum.de) wrote on 27 February 2009 19:25:
>  >As a matter of fact, changing the program name works better in my case. 
>  >We do all the logging straight to /var/log/messages and then use regex's 
>  >to separate.
>  >Using program names dnsmasq, dnsmasq-dhcp and dnsmasq-tftp makes that a 
>  >trivial exercise. Much easier than first filtering on dnsmasq and than 
>  >identifying logs with and without DHCP:
> 
> I think changing the name is bad practice; I know of no other daemon
> that does it. I'm not saying this for me, because I don't use syslog
> with dnsmasq; syslog is usually a bad solution, it's much better for
> the daemon to write its own log. It should however have proper support
> for this, namely permit log rotation through a signal, which dnsmasq
> does.
> 
>  >How about this:
> 
>  > - Add an option --log-separation which is disabled by default.
> 
> How about creating separate logs directly? We keep log-facility for
> dns, and if {dhcp,tftp}-log-facility are defined the corresponding log
> files are used, otherwise the entries are sent to log-facility. This
> way we don't change what already exists, don't clutter the program and
> don't obsolete the translations.
> 
That's  nice idea. I can see two potential problems: 1) The syslog() 
system is not extensible, so it would be necessary to (mis)use some 
exiting facilities (FTP? LPR?). 2) It might be difficult for Olaf to map 
from facility to his log-spliting facility.

What do you think, Olaf?

Simon.



More information about the Dnsmasq-discuss mailing list