# DHCPD logging?

## EnigmaedgE

I have dhcpd and syslog-ng installed but I can't seem to figure out how to get the logging/debug messages sent to /var/log/{messages|dhcpd.log}.

I've looked all over google and went through the docs, but I can't figure out how to get it working!

Thanks for any help in advance!

----------

## hanj

I have this in my dhcpd.conf

```
log-facility local7;
```

And it writes in /var/log/messages. I'm using syslog-ng as a logger.

HTH

hanji

----------

## EnigmaedgE

Well, I have that line as wel in my *.conf file.   Does it matter that I'm running dhcpd chroot'd?

Thanks!

----------

## hanj

I'm running chroot'd as well. Is DHCP running, etc? Can you see it in the process list?

hanji

----------

## hanj

heh.. found my stuff in syslog-ng.conf.. this might help:

```
destination dhcp { file("/var/log/dhcp.log"); };

filter f_dhcp { facility(local7); };

log { source(src); filter(f_dhcp); destination(dhcp); };
```

hanji

----------

## EnigmaedgE

yup, I tried those lines... and I made sure that the dhcpd.log (i have /var/log/dhcpd.log set for file{}) exists.

Still doesn't work =(

----------

## EnigmaedgE

Here are my conf files. I'm a bit tired, so maybe there's something I've missed.

/var/dhcp/etc/dhcp/dhcpd.conf

```

# dhcpd.conf

#

# Sample configuration file for ISC dhcpd

#

# option definitions common to all supported networks...

option domain-name "XXXXXXXXXXX";

option domain-name-servers xxx.xxx.xxx.xxx;

ddns-update-style interim;

default-lease-time 2592000;

max-lease-time 2592000;

# If this DHCP server is the official DHCP server for the local

# network, the authoritative directive should be uncommented.

authoritative;

# 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;

# No service will be given on this subnet, but declaring it helps the

# DHCP server to understand the network topology.

...
```

/etc/syslog-ng/syslog-ng.conf

```

# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.conf.gentoo,v 1.5 2005/05/12 05:46:10 mr_bones_ Exp $

#

# Syslog-ng default configuration file for Gentoo Linux

# contributed by Michael Sterrett

options {

        chain_hostnames(off);

        sync(0);

        # The default action of syslog-ng 1.6.0 is to log a STATS line

        # to the file every 10 minutes.  That's pretty ugly after a while.

        # Change it to every 12 hours so you get a nice daily update of

        # how many messages syslog-ng missed (0).

        stats(43200);

};

source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); };

destination messages { file("/var/log/messages"); };

destination dhcp { file("/var/log/dhcpd.log"); };

# By default messages are logged to tty12...

destination console_all { file("/dev/tty12"); };

# ...if you intend to use /dev/console for programs like xconsole

# you can comment out the destination line above that references /dev/tty12

# and uncomment the line below.

#destination console_all { file("/dev/console"); };

filter f_dhcp { facility(local7); };

log { source(src); filter(f_dhcp); destination(dhcp); };

log { source(src); destination(messages); };

log { source(src); destination(console_all); };

```

----------

## hanj

 *EnigmaedgE wrote:*   

> Does it matter that I'm running dhcpd chroot'd?

 

Shouldn't your dhcpd.conf be in /chroot/dhcp/etc/dhcp/dhcpd.conf? Just want to check that first.

hanji

----------

## EnigmaedgE

Upon installation, I changed it to /var/.  Was trying to keep my chroot'd services in here (along with postgresql, dns, etc.)

Thanks again!

----------

