# logging chrooted dhcpd

## Seather

I have moved my dhcpd to a chrooted environment by doing:

```
ebuild /var/db/pkg/net-misc/dhcp-3.0_p2-r6/dhcp-3.0_p2-r6.ebuild config
```

and restarting dhcp.

Everything is working perfectly, except for logging. The ebuild config told me:

 * To enable logging from the DHCP server, configure your

 * logger (app-admin/sysklogd-1.4.1-r11) to listen on /chroot/dhcp/dev/log

However /chroot/dhcp/dev is empty and I have no idea how to set sysklogd to "listen on /chroot/dhcp/dev/log".

I also have this line in my dhcpd.conf:

```
log-facility local7;
```

Is this correct?

----------

## mryoung_fr

hi, i don't know if you have solve your problem ... but i had the same, and i found a way to log dhcp stuff to specific local while dhcp is in a chroot jail

first, hack your syslog.conf to set something like that:

local0.* -/var/log/dhcp.log

next, configure your dhcpd.conf to add something like that:

log-facility local0;

(the log facility must be the same as the one used in syslog.conf)

next, hack your /etc/init.d/sysklogd to add a log socket to the dev directory in the dhcp root jail.

for this modify SYSLOGD from "-m 0" to "-m 0 -a /chroot/dhcp/dev/log"

and that's it !

----------

## gtsquirrel

The proper solution for this is to modify your /etc/syslog-ng/syslog-ng.conf file.  In that file, you'll see a line that looks like this:

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

Modify this line to include the dhcp chroot path:

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

When you restart syslog-ng, the character device /chroot/dhcp/dev/log will be created for your automagically and all logs will point to the syslog-ng output file(s).

Enjoy!

chris

----------

