dhcpkit.common.server.logging.config_elements module¶
The basic configuration objects for logging
-
class
dhcpkit.common.server.logging.config_elements.
ConsoleHandlerFactory
(section: ZConfig.matcher.SectionValue)[source]¶ Bases:
dhcpkit.common.server.config_elements.ConfigElementFactory
Factory for a logging handler that logs to the console, optionally in colour.
-
class
dhcpkit.common.server.logging.config_elements.
FileHandlerFactory
(section: ZConfig.matcher.SectionValue)[source]¶ Bases:
dhcpkit.common.server.config_elements.ConfigElementFactory
Factory for a logging handler that logs to a file, optionally rotating it.
-
static
name_datatype
(v)¶
-
static
-
class
dhcpkit.common.server.logging.config_elements.
Logging
(section: ZConfig.matcher.SectionValue)[source]¶ Bases:
dhcpkit.common.server.config_elements.ConfigSection
Class managing the configured logging handlers.
-
configure
(logger: logging.Logger, verbosity: int = 0) → int[source]¶ Add all configured handlers to the supplied logger. If verbosity > 0 then make sure we have a console logger and force the level of the console logger based on the verbosity.
Parameters: - logger – The logger to add the handlers to
- verbosity – The verbosity level given as command line argument
Returns: The lowest log level that is going to be handled
-
-
class
dhcpkit.common.server.logging.config_elements.
SysLogHandlerFactory
(section: ZConfig.matcher.SectionValue)[source]¶ Bases:
dhcpkit.common.server.config_elements.ConfigElementFactory
Factory for a logging handler that logs to syslog.
-
create
() → logging.handlers.SysLogHandler[source]¶ Create a syslog handler
Returns: The logging handler
-
default_destinations
= ('/dev/log', '/var/run/syslog', 'localhost:514')¶
-
static
name_datatype
(value)¶
-