/** * Shutting down a hierarchy will <i>safely</i> close and remove * all appenders in all categories including the root logger. * * <p>Some appenders such as {@link LoggerSocketAppender} * need to be closed before the * application exists. Otherwise, pending logging events might be * lost. * * <p>The shutdown method is careful to close nested * appenders before closing regular appenders. This is allows * configurations where a regular appender is attached to a logger * and again to a nested appender. */ function shutdown() { $this->root->removeAllAppenders(); $cats =& $this->getCurrentLoggers(); $enumCats = sizeof($cats); if ($enumCats > 0) { for ($i = 0; $i < $enumCats; $i++) { $cats[$i]->removeAllAppenders(); } } }
/** * @expectedException PHPUnit_Framework_Error * @expectedExceptionMessage log4php: Cannot set LoggerRoot level to null. */ public function testNullLevelWarning() { $root = new LoggerRoot(); $root->setLevel(null); }
function exceptionHandling($className, $methodName, $exception) { $this->log->error("{$className}->{$methodName}", $exception); }