DHCP Logging

DHCP logging is configured in config-kea-dhcp4-log mode. To enter this mode, start in config-kea-dhcp4 mode and issue the logging <logger-name> command.

The <logger-name> parameter must be one of these names:

kea-dhcp4

Default DHCPv4 logging behavior, used when no settings exist for a specific logger.

kea-dhcp4.alloc-engine

DHCPv4 lease allocation events.

kea-dhcp4.bad-packets

DHCPv4 packets that are dropped or rejected.

kea-dhcp4.callouts

DHCPv4 hook point callout registration/execution.

kea-dhcp4.commands

DHCPv4 commands received over the command channel.

kea-dhcp4.ddns

DHCPv4 client FQDN and Hostname option processing.

kea-dhcp4.dhcp4

DHCPv4 server basic operations.

kea-dhcp4.dhcpsrv

DHCPv4 libkea-dhcpsrv library default logging.

kea-dhcp4.eval

DHCPv4 client classification expression evaluation.

kea-dhcp4.hooks

DHCPv4 hook registration/deregistration.

kea-dhcp4.hosts

DHCPv4 host reservation management.

kea-dhcp4.leases

DHCPv4 lease allocation.

kea-dhcp4.options

DHCPv4 option processing/parsing/encoding.

kea-dhcp4.packets

DHCPv4 packet reception/transmission.

kea-dhcp4.stat-cmds-hooks

DHCPv4 libdhcp_stat_cmds library default logging.

For example:

tnsr(config-kea-dhcp4)# logging kea-dhcp4
tnsr(config-kea-dhcp4-log)#

See also

See the Kea documentation for Logging. for a list of values and their meanings.

DHCP Logging Options

config-kea-dhcp4-log mode contains the following commands:

debug-level <level>

The amount of debug information to log, when a log message is classified using the debug severity level. From 0 (lowest detail) to 99 (most detail).

output <location>

Sets the log output location and enters config-kea-dhcp4-log-out mode to further configure behavior for the given location. The <location> must be one of:

stdout

Log messages to standard output.

stderr

Log messages to standard error.

syslog

Log messages to syslog using the daemon name.

syslog:<name>

Log messages to syslog using the given <name.

<filename>

The full path and filename in which to log messages.

severity (debug|error|fatal|info|warn)

The severity level of messages to write in the log:

fatal

Errors severe enough to cause the daemon to exit.

error

Errors which are notable but otherwise do not prevent the daemon from functioning.

warn

Unusual conditions which are not normal but also not causing problems.

info

General noteworthy events and other similar messages.

debug

Debugging messages, which are highly informative but also verbose. The amount of debugging information can be further controlled by the debug-level command.

DHCP Log Output

The output <location> command from config-kea-dhcp4-log mode enters config-kea-dhcp4-log-out mode, which contains the following commands:

flush (false|true)

Flush the log buffer after writing each line. Lowers performance but ensures that every log message is written completely. This can help in cases where the daemon dies before the log buffer is emptied.

maxsize <size>

When logging to a file, this option controls the maximum size of the log file before it is rotated. Default value is 10240000 (10MB).

maxver <rotate>

When logging to a file and rotation is enabled, this command controls how many previous log files are retained when performing log rotation. The default value is 1, which is also the minimum allowed value.

If the value of maxsize is greater than 204800, the daemon will perform log rotation when the size of the log file exceeds maxsize. When rotating logs, the current log will be renamed to <filename>.1. If <filename>.1 already exists, it will be renamed to <filename>.2, and so on until the number of log files reaches the value of maxver. Older log files beyond the limit set by maxver are removed.