Logger.php in Monolog 8
File
src/Logger/Logger.php
View source
<?php
namespace Drupal\monolog\Logger;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Logger\RfcLogLevel;
use Drupal\Core\Session\AccountInterface;
use Monolog\Logger as BaseLogger;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
class Logger extends BaseLogger implements LoggerChannelInterface {
protected $levelTranslation = array(
RfcLogLevel::EMERGENCY => MonologLogLevel::EMERGENCY,
RfcLogLevel::ALERT => MonologLogLevel::ALERT,
RfcLogLevel::CRITICAL => MonologLogLevel::CRITICAL,
RfcLogLevel::ERROR => MonologLogLevel::ERROR,
RfcLogLevel::WARNING => MonologLogLevel::WARNING,
RfcLogLevel::NOTICE => MonologLogLevel::NOTICE,
RfcLogLevel::INFO => MonologLogLevel::INFO,
RfcLogLevel::DEBUG => MonologLogLevel::DEBUG,
);
public function addRecord($level, $message, array $context = array()) {
if (array_key_exists($level, $this->levelTranslation)) {
$level = $this->levelTranslation[$level];
}
parent::addRecord($level, $message, $context);
}
public function setRequestStack(RequestStack $requestStack = NULL) {
}
public function setCurrentUser(AccountInterface $current_user = NULL) {
}
public function setLoggers(array $loggers) {
}
public function addLogger(LoggerInterface $logger, $priority = 0) {
}
}
Classes
Name |
Description |
Logger |
Logger class for the Drupal Monolog module. |