[opensuse 10.3] dhcp log to another file

My logs are going to /var/log/messages. I touched /var/log/dhcp.log file and chmod 640 /var/log/dhcp.log. And put the following in my /etc/syslog-ng/syslog-ng.conf file (at the end of the file):

filter f_daemon { facility(daemon); };
filter f_dhcpd { match(”dhcpd”); };
destination dhcpmessages { file(”/var/log/dhcp.log”); };
log { source(src); filter(f_daemon); filter(f_dhcpd); destination(dhcpmessages); };

I have also edited /etc/dhcpd.conf file and added:

log-facility local7;

and restarted dhcpd.

But my logs are still going to /var/log/messages file.

Noticed in my /etc/sysconfig/syslog file two entries regarding dhcp

SYSLOGD_ADDITIONAL_SOCKET_DHCP=“/var/lib/dhcp/dev/log”
SYSLOGD_ADDITIONAL_SOCKET_NAMED=“/var/lib/named/dev/log”

Not sure what they are.

How do I redirect my logs to /var/log/dhcp.log? The dhcp process is running as user dhcpd.

Thanks.

Update:

I have removed log-facility local7; from /etc/dhcpd.conf and restarted dhcpd.

Edited /etc/syslog-ng/syslog-ng.conf file and added:

filter f_dhcpd { facility(daemon) and match(‘dhcpd:’); };
destination dhcpmessages { file(/var/log/dhcpd.log); };
log { source(src); filter(f_dhcpd); destination(dhcpmessages);};

and restarted syslog-ng. Now I am getting dhcp logs both in /var/log/messages and /var/log/dhcpd.log file.

How do I stop it going to the /var/log/messages file?

You have the edit the filter f_messages to exclude DHCP messages.

thanks that resolved the issue