LoggerAppenderSyslogLoggerAppenderSyslog logs events to the syslog. LayoutThis appender requires a layout. If no layout is specified in configuration, LoggerLayoutSimple will be used by default. ParametersThe following parameters are available:
PrioritiesThe priority is the syslog equivalent of the log4php level. Here's a list of priorities available in syslog and the equivalent log4php levels.
Messages with level FATAL will be logged using the syslog's ALERT priority; ERROR level message will use ERR priority, etc. Note that there is no priority below DEBUG, therefore both TRACE and DEBUG level mesages will be logged using the DEBUG syslog priority. FacilitiesThe facility parameter is used to specify what type of program is logging the message. This allows you to specify (in your machine's syslog configuration) how messages coming from different facilities will be handled. The following facilities are available:
Warning: USER is the only facility available on Windows operating systems. OptionsThe following additional syslog options may be defined via the option parameter:
Multiple options may be set by separating them with a pipe character. For example CONS|PID|NODELAY. ExamplesHere is a sample configuration:
<configuration xmlns="http://logging.apache.org/log4php/">
<appender name="default" class="LoggerAppenderSyslog">
<layout class="LoggerLayoutSimple" />
<param name="ident" value="log4php-test" />
<param name="facility" value="LOCAL0" />
<param name="option" value="NDELAY|PID" />
</appender>
<root>
<appender_ref ref="default" />
</root>
</configuration>
array(
'appenders' => array(
'default' => array(
'class' => 'LoggerAppenderSyslog',
'layout' => array(
'class' => 'LoggerLayoutSimple',
),
'params' => array(
'ident' => 'log4php-test',
'facility' => 'LOCAL0',
'option' => 'NDELAY|PID'
),
),
),
'rootLogger' => array(
'appenders' => array('default'),
),
);
|