# $Id$ # # Sample Log4CPP Configuration File # # This file contains sample configuration data for the log4cpp API. Strictly # speaking, users are not required to configure log4cpp, but many do. The # SimpleConfigurator class along with this file is one way to do so. # # Each line is of one of the following four forms described in greater detail # below: # # category # appender # priority (EMERG|FATAL|ALERT|CRIT|ERROR|WARN|NOTICE|INFO|DEBUG) # # # # # CATEGORY # Lines beginning with the keyword "category" are declarations of a logging # category. Categories are defined at their first occurrence, so an explicit # declaration is unnecessary. It is useful though as documentation heading a # section of configuration statements. # # Definitions # - string representing the name of a category, e.g. myLog # # # APPENDER # Lines beginning with the keyword "appender" define the format and output # method of log messages. A category may have more than one appender, each # having a different format and output method. However, while log4cpp has the # capability to assign priorities to appenders, this feature is not available # from configuration files at the present time. # # Definitions # - root or any custom category you would like defined, e.g. myLog # - (basic|simple|(pattern )) # - any string (max 1000 chars) where the following # substitutions may be used: # %% - a single percent sign # %c - the category # %d - the date # %D - seconds since 1970 # %m - the message # %n - the platform specific line separator # %p - the priority # %r - milliseconds since this layout was created # %R - seconds since Jan 1, 1970 # %u - clock ticks since process start # %x - the NDC (Nested Diagnostic Context) # - (||console|stdout|stderr|| # ) # - file # - name of the log file # - rolling # - maximum size of a log file (in bytes) before it is rolled # - maximum index of log files before they are deleted # - syslog [] # - syslog facility as #defined in sys/syslog.h, default LOG_USER # - remotesyslog [facility [port]] # - remote machine name # - port number of syslog on the remote machine, default 514 # # # PRIORITY # Lines beginning with the keyword "priority" set the maximum log level for a # category. EMERG and FATAL are synonymous and represent the lowest log level. # DEBUG is the highest log level. # # Definitions # - root or any custom category you would like defined, e.g. myLog # # # # (COMMENT) # Lines beginning with "#" are comments and are ignored. The "#" must appear # as the first character. In-line comments are not allowed. # # Set root category's priority level to DEBUG # No appender is set so the default one will be used priority root DEBUG # Create a foo category, set its priority to WARN, and send the output to a file priority foo WARN appender foo basic file /var/log/foo.log