/** * @param Payone_Log4php_LoggerLoggingEvent $event * @return string */ public function format(Payone_Log4php_LoggerLoggingEvent $event) { $sbuf = PHP_EOL . "<tr>" . PHP_EOL; $sbuf .= "<td>"; $sbuf .= $event->getTime(); $sbuf .= "</td>" . PHP_EOL; $sbuf .= "<td title=\"" . $event->getThreadName() . " thread\">"; $sbuf .= $event->getThreadName(); $sbuf .= "</td>" . PHP_EOL; $sbuf .= "<td title=\"Level\">"; $level = $event->getLevel(); if ($level->equals(Payone_Log4php_LoggerLevel::getLevelDebug())) { $sbuf .= "<font color=\"#339933\">{$level}</font>"; } else { if ($level->equals(Payone_Log4php_LoggerLevel::getLevelWarn())) { $sbuf .= "<font color=\"#993300\"><strong>{$level}</strong></font>"; } else { $sbuf .= $level; } } $sbuf .= "</td>" . PHP_EOL; $sbuf .= "<td title=\"" . htmlentities($event->getLoggerName(), ENT_QUOTES) . " category\">"; $sbuf .= htmlentities($event->getLoggerName(), ENT_QUOTES); $sbuf .= "</td>" . PHP_EOL; if ($this->locationInfo) { $locInfo = $event->getLocationInformation(); $sbuf .= "<td>"; $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES) . ':' . $locInfo->getLineNumber(); $sbuf .= "</td>" . PHP_EOL; } $sbuf .= "<td title=\"Message\">"; $sbuf .= htmlentities($event->getRenderedMessage(), ENT_QUOTES); $sbuf .= "</td>" . PHP_EOL; $sbuf .= "</tr>" . PHP_EOL; if ($event->getNDC() != null) { $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">"; $sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES); $sbuf .= "</td></tr>" . PHP_EOL; } return $sbuf; }
/** * Check whether this Logger is enabled for the DEBUG Level. * @return boolean */ public function isDebugEnabled() { return $this->isEnabledFor(Payone_Log4php_LoggerLevel::getLevelDebug()); }
/** * Reset all values contained in this hierarchy instance to their * default. * * This removes all appenders from all loggers, sets * the level of all non-root loggers to <i>null</i>, * sets their additivity flag to <i>true</i> and sets the level * of the root logger to {@link LOGGER_LEVEL_DEBUG}. * * <p>Existing loggers are not removed. They are just reset. * * <p>This method should be used sparingly and with care as it will * block all logging until it is completed.</p> */ public function resetConfiguration() { $root = $this->getRootLogger(); $root->setLevel(Payone_Log4php_LoggerLevel::getLevelDebug()); $this->setThreshold(Payone_Log4php_LoggerLevel::getLevelAll()); $this->shutDown(); foreach ($this->loggers as $logger) { $logger->setLevel(null); $logger->setAdditivity(true); $logger->removeAllAppenders(); } $this->rendererMap->clear(); Payone_Log4php_LoggerAppenderPool::clear(); }