[Dnsmasq-discuss] Patch to change dnsmasq logentries
Olaf Westrik
weizen_42 at ipcop-forum.de
Fri Feb 27 07:06:11 GMT 2009
Hi,
please consider attached patch against dnsmasq 2.47 for inclusion.
Purpose: easily identify and separate log messages for the DHCP part.
Messages from dnsmasq DHCP part start with DHCP:. This allows easier
separation for user presentation.
Example logging:
Feb 27 07:38:09 fw dnsmasq[29780]: started, version 2.47 cachesize 150
Feb 27 07:38:09 fw dnsmasq[29780]: compile time options: IPv6 GNU-getopt
no-DBus no-I18N TFTP
Feb 27 07:38:09 fw dnsmasq[29780]: DHCP: static leases only on
192.168.3.1, lease time 1h
Feb 27 07:38:09 fw dnsmasq[29780]: DHCP: IP range 192.168.2.2 --
192.168.2.50, lease time 1h
Feb 27 07:38:09 fw dnsmasq[29780]: reading /var/ipcop/red/resolv.conf
Feb 27 07:38:09 fw dnsmasq[29780]: using nameserver 192.168.1.1#53
Feb 27 07:38:09 fw dnsmasq[29780]: read /etc/hosts - 4 addresses
Feb 27 07:38:40 fw dnsmasq[29780]: DHCP: DHCPDISCOVER(lan-1)
00:12:3F:20:11:f1
Feb 27 07:38:40 fw dnsmasq[29780]: DHCP: DHCPOFFER(lan-1) 192.168.2.44
00:12:3F:20:11:f1
Feb 27 07:38:41 fw dnsmasq[29780]: DHCP: DHCPREQUEST(lan-1)
192.168.10.44 00:3F:56:20:11:f1
Feb 27 07:38:41 fw dnsmasq[29780]: DHCP: DHCPACK(lan-1) 192.168.2.44
00:12:3F:20:11:f1
Some background: IPCop is a Linux Firewall distribution, which (among
many other things) has a webinterface including log display.
Log messages are separated into different sections for better usability.
Some sections are kernel related, internet connection, IPsec tunnels,
etc. etc.
Separate log sections exist for DNS and DHCP server, which is not a
problem in our current version where we use ISC DHCP daemon and thus can
easily separate messages between the dnsmasq and dhcpd process.
However in the next major release we want to change that and use dnsmasq
as both DNS and DHCP server.
Now I could also use a search for DHCP in the log messages, but some
DHCP related log seem to lack such info.
I think that using an easy to spot text at the start makes it easier for
regex-ing and improves consistency.
thanks and keep up the good work
Olaf
PS: while at it I also modified the TFTP part.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dnsmasq-2.47-separate_log_entries.patch
Type: text/x-diff
Size: 17529 bytes
Desc: not available
Url : http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20090227/3e6eccd4/dnsmasq-2.47-separate_log_entries-0001.bin
More information about the Dnsmasq-discuss
mailing list