I created the following log4php configuration file and wondered, why a
$logger->debug('xyz')
on ldap-logger created an formatted log4php-output on the webpage:
return array(
'rootLogger' => array(
'level' => 'FATAL',
'appenders' => array('echo'),
),
'loggers' => array(
'ldap' => array(
'level' => 'DEBUG',
'appenders' => array('email'),
),
),
'appenders' => array(
'echo' => array(
'class' => 'LoggerAppenderEcho',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
),
'email' => array(
'class' =>
'LoggerAppenderMailEvent',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
'from' => '[email protected]',
'to' => '[email protected]',
'subject' => 'Error',
'smtpHost' => '0.0.0.0',
),
),
);
In my understanding, the rootLogger only should log in case of FATAL
errors!?
Florian
