/** * Add a {@link LoggerAppenderConsole} that uses * the {@link LoggerLayoutTTCC} to the root category. * * @param string $url not used here */ public static function configure($url = null) { $root = LoggerManager::getRootLogger(); $appender = new LoggerAppenderConsole('A1'); $appender->setLayout(new LoggerLayoutTTCC()); $root->addAppender($appender); }
/** * Add a {@link LoggerAppenderConsole} that uses * the {@link LoggerLayoutTTCC} to the root category. * * @param string $url not used here */ public function configure(LoggerHierarchy $hierarchy, $url = null) { $root = $hierarchy->getRootLogger(); $appender = new LoggerAppenderConsole('A1'); $appender->setLayout(new LoggerLayoutTTCC()); $appender->activateOptions(); $root->addAppender($appender); }
public function testSimpleDefaultLogging() { $layout = new LoggerLayoutSimple(); $event = new LoggerLoggingEvent('LoggerAppenderConsoleTest', new Logger('mycategory'), LoggerLevel::getLevelWarn(), "my message"); $appender = new LoggerAppenderConsole("mylogger"); $appender->setLayout($layout); $appender->activateOptions(); $appender->append($event); $appender->close(); }