This page contains definition of a logging section of a linknx [Configuration] file.
Linknx support 2 different logging back-ends:
The choice between these 2 possibilities is made at compilation time. By default, the configure script will auto-detect the presence of the log4cpp library and use it if available. You can force log4cpp by passing --with-log4cpp option to configure script or disable it with option --without-log4cpp.
With Internal logger, the following parameters are available:
<logging format="simple" level="WARN"/>
If parameter format is omitted or its value is different from "simple", the timestamp will be added in front of each log line.
The parameter level determine the minimum level of logging. The valid values are "DEBUG", "INFO", "NOTICE", "WARN" and "ERROR". The default value is "INFO". The level "DEBUG" is disabled in normal builds when using the internal logger.
The log messages for level ERROR or WARN go to stderr, all other messages go to stdout.
With log4cpp logger, the logging configuration looks like this:
<logging output="/var/log/linknx.log" format="%d{%Y%m%d %H:%M:%S,%l} %5p %c %x: %m%n" level="INFO"/>
The allowed parameters are:
The format pattern syntax allows the following fields:
format="simple" corresponds to "%p - %m%n" and format="basic" to "%R %p %c %x: %m%n".
The default value (if format is not specified or empty) is "%d [%5p] %c: %m%n"
More details about pattern layout can be found in log4j documentation but some of them are not supported by log4cpp
If parameter "config" is used, the value of that parameter is used as the name of the file containing log4cpp configuration. All other parameters are ignored. A sample configuration file that logs all warning and errors to a file and everything to the console can be found in linknx/conf/logging.conf (See log4cpp configuration for more details):
<logging config="/var/lib/linknx/logging.conf"/>