From: Tomek Mrugalski Date: Tue, 23 Sep 2014 11:23:13 +0000 (+0200) Subject: [3536] Changes after review: X-Git-Tag: rt3470_base~14^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fdd723808bd8a6c79487186545e6364268d162a;p=thirdparty%2Fkea.git [3536] Changes after review: - Logging section updated. - Missing coma in kea.conf.pre added - ${localstatedir}/log is now created --- diff --git a/Makefile.am b/Makefile.am index 25dd138bef..ea0d5786bd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -119,6 +119,10 @@ cppcheck: --template '{file}:{line}: check_fail: {message} ({severity},{id})' \ src +# These steps are necessary during installation +install-exec-hook: + mkdir -p $(DESTDIR)${localstatedir}/log/ + ### include tool to generate documentation from log message specifications ### in the distributed tarball: EXTRA_DIST = tools/system_messages.py diff --git a/doc/guide/logging.xml b/doc/guide/logging.xml index d740f035ff..b6394ea83e 100644 --- a/doc/guide/logging.xml +++ b/doc/guide/logging.xml @@ -4,6 +4,18 @@ ]> + + Logging @@ -14,33 +26,41 @@ During its operation Kea may produce many messages. They differ in severity (some are more important than others) and source (some are produced by specific components, e.g. hooks). It is useful to understand - which log messages are needed and which are not. For example debug level - messages can be safely ignored in a typical deployment. They are, - however, very useful when debugging a problem. + which log messages are needed and which are not and configure your + logging appropriately. For example debug level messages can be safely + ignored in a typical deployment. They are, however, very useful when + debugging a problem. The logging system in Kea is configured through the - Logging module. All modules will look at the - configuration in Logging to see what should - be logged and to where. This allows sharing identical logging - configuration between components. + Logging structure in your configuration + file. All daemons (e.g. a DHCPv4 and DHCPv6 servers) will look at the + configuration in the Logging structure to see + what should be logged and to where. This allows sharing identical + logging configuration between daemons.
Loggers - Within Kea, a message is logged through a component - called a "logger". Different parts of log messages + Within Kea, a message is logged through an entity + called a "logger". Different parts of the code log messages through different loggers, and each logger can be configured - independently of one another. + independently of one another. For example there are different + components that deal with hooks ("hooks" logger) and with + DHCP engine ("dhcpsrv" logger). - In the Logging module, you can specify the configuration - for zero or more loggers; any that are not specified will - take appropriate default values. + In the Logging structure in a configuration file you can + specify the configuration for zero or more loggers. If there are + no specified loggers, the code will use default values which + cause Kea to log messages on at least INFO severity to standard + output. + @@ -57,45 +77,44 @@ Each logger in the system has a name, the name being that of the component binary file using it to log messages. For instance, if you - want to configure logging for the Dhcp4 module, you add an entry for - a logger named kea-dhcp4. This configuration will - then be used by the loggers in the Dhcp4 module, and all the - libraries used by it (unless a library defines its own logger). + want to configure logging for the DHCPv4 server, you add an entry + for a logger named kea-dhcp4. This configuration will + then be used by the loggers in the DHCPv4 server, and all the + libraries used by it (unless a library defines its own logger and + there is specific logger configuration that applies to that logger). - - - If you want to specify logging for one specific library within the - module, you set the name to - module.library. For example, the logger + If you want to specify logging for one specific library within a + daemon, you set the name to + daemon.library. For example, the logger used by the code from libdhcpsrv used in kea-dhcp4 binary has the full name of kea-dhcp4.dhcpsrv. If there is no entry in Logging for a particular library, it will use the configuration - given for the module. + given for the whole daemon. To illustrate this, suppose you want the dhcpsrv library to log messages of severity DEBUG, and the rest of the - Dhcp4 code to log messages of severity INFO. To achieve + DHCPv4 server code to log messages of severity INFO. To achieve this you specify two loggers, one with the name kea-dhcp4 and severity INFO, and one with the name kea-dhcp4.dhcpsrv with severity DEBUG. As there are no entries for other libraries, - they will use the configuration for the module + they will use the configuration for the daemon (kea-dhcp4), so giving the desired behavior. - @@ -103,17 +122,17 @@ that might match a particular logger, the specification with the more specific logger name takes precedence. For example, if there are entries for both kea-dhcp4 and - kea-dhcp4.dhcpsrv, the Dhcp4 module — and all + kea-dhcp4.dhcpsrv, the DHCPv4 server — and all libraries it uses that are not dhcpsrv — will log messages according to the configuration in the first entry (kea-dhcp4). - One final note about the naming. When specifying the module name + One final note about the naming. When specifying the daemon name within a logger, use the name of the binary file, - e.g. kea-dhcp4 for the DHCPv4 module, - kea-dhcp6 for the DHCPv6 module, etc. When the + e.g. kea-dhcp4 for the DHCPv4 server, + kea-dhcp6 for the DHCPv6 server, etc. When the message is logged, the message will include the name of the process (e.g. kea-dhcp4) followed by the specific component in that process, e.g. hooks. It is possible to @@ -130,25 +149,41 @@ - kea-dhcp4.dhcp4 + kea-dhcp4.dhcp4 - this is the logger + used by DHCPv4 server code in cases, where there is no more + specialized logger. - kea-dhcp4.dhcpsrv + kea-dhcp4.dhcpsrv - this logger is used + by the libdhcpsrv library. This covers mostly DHCP engine (the lease + allocation and renewal process), database operations and + configuration. - kea-dhcp4.hooks + kea-dhcp4.hooks - this logger is used + during DHCPv4 hooks operation, i.e. anything related to user + libraries will be logged using this logger. - kea-dhcp6.dhcp6 + kea-dhcp6.dhcp6 - this logger is used + by DHCPv6 server code in cases, where there is no more specialzed + logger. - kea-dhcp6.dhcpsrv + kea-dhcp6.dhcpsrv - this logger is used + by the libdhcpsrv library. This covers mostly DHCP engine (the lease + allocation and renewal process), database operations and + configuration. - kea-dhcp6.hooks + kea-dhcp6.hooks - this logger is used + during DHCPv6 hooks operation, i.e. anything related to user + libraries will be logged using this logger. - kea-dhcp-ddns.dhcpddns + kea-dhcp-ddns.dhcpddns - this is the + default logger for kea-dhcp-ddns daemon. This logger is not used + in DHCPv4 or DHCPv6 servers. @@ -249,26 +284,6 @@ TODO; there's a ticket to determine these levels, see #1074
- -
- additive (true or false) - - - - If this is true, the from - the parent will be used. For example, if there are two - loggers configured; Dhcp4 and - Dhcp4.dhcpsrv, and - is true in the second, it will write the log messages - not only to the destinations specified for - Dhcp4.dhcpsrv, but also to the destinations - as specified in the in - the logger named Dhcp4. - - - -
-
@@ -490,9 +505,9 @@ file be created. [kea-dhcp4.dhcpsrv/27456] - The source of the message. This comprises two components: + The source of the message. This comprises two elements: the Kea process generating the message (in this - case, kea-dhcp4) and the module + case, kea-dhcp4) and the component within the program from which the message originated (which is the name of the common library used by DHCP server implementations). The number after the slash is a process id diff --git a/src/bin/keactrl/kea.conf.pre b/src/bin/keactrl/kea.conf.pre index 243846b87f..5dfdb5333d 100644 --- a/src/bin/keactrl/kea.conf.pre +++ b/src/bin/keactrl/kea.conf.pre @@ -92,7 +92,7 @@ ], "severity": "INFO", "debuglevel": 0 - } + }, { "name": "kea-dhcp-ddns", "output_options": [