Extracted at 2014-06-26.
pike.ida.liu.se
[Top]
Tools
Tools.Logging

Module Tools.Logging

Description

configuration file is standard ini-style.

[logger.logger_name] <-- configures a logger named "logger_name", loggers are hierarchal, with "." separating the various components in the logger hierarchy. For example, "myapp.subsystem.component". The root logger from which all configurations inherit, is called "default".

level=TRACE|DEBUG|INFO|WARN|ERROR <-- optional log level for this logger

appender=appender_name <-- use the appender "appender_name", may be specified multiple times

class=Some.Pike.Class <-- use the specified pike class as logger, defaults to Tools.Logging.Log.Logger

additivity=false <-- do not use the parent configuration as a basis for this logger's configuration to override. Defaults to "true", in which case any value not specified in the child will be sourced from the parent. If set to true, any logger targets from the parent will also be added to the child.

enable=true/false/yes/no <-- whether the logger should generate entries

[appender.appender_name] <-- configures an appender named "appender_name"

class=Some.Pike.Class <-- use the specified pike class for appending

format=someformatstring you may include replacements in the format to place different data according to your preferences. the format for specifying a replacement is %{field}, available fields differ between loggers, but generally include the following: name, level, msg, pid, host plus any of the values from localtime ().

see also the note below about configuration variables, which may be inserted into your format string (values are inserted at configuration time, and are static thereafter).

enable=true/false/yes/no <-- whether the appender should generate entries

example: Tools.Logging.Log.FileAppender uses argument "file" to specify logging file

Note

if the configuring application specifies any, you may use substitution variables in the form ${varname} in your configuration values. By default, "host", "user" and "pid" are available.

Note

regardless of configuration, a default logger will always be available. a configuration file may specify an alternate default logger configuration by using a config section called [default.logger].