77    const EMERGENCY = 600;
 
   94    protected static $levels = array(
 
   97        self::NOTICE    => 
'NOTICE',
 
   98        self::WARNING   => 
'WARNING',
 
   99        self::ERROR     => 
'ERROR',
 
  100        self::CRITICAL  => 
'CRITICAL',
 
  101        self::ALERT     => 
'ALERT',
 
  102        self::EMERGENCY => 
'EMERGENCY',
 
  134    protected $microsecondTimestamps = 
true;
 
  144        $this->handlers = $handlers;
 
  145        $this->processors = $processors;
 
  177        array_unshift($this->handlers, 
$handler);
 
  189        if (!$this->handlers) {
 
  190            throw new \LogicException(
'You tried to pop from an empty handler stack.');
 
  193        return array_shift($this->handlers);
 
  206        $this->handlers = array();
 
  207        foreach (array_reverse($handlers) as 
$handler) {
 
  219        return $this->handlers;
 
  230        if (!is_callable($callback)) {
 
  231            throw new \InvalidArgumentException(
'Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, 
true).
' given');
 
  233        array_unshift($this->processors, $callback);
 
  245        if (!$this->processors) {
 
  246            throw new \LogicException(
'You tried to pop from an empty processor stack.');
 
  249        return array_shift($this->processors);
 
  257        return $this->processors;
 
  275        $this->microsecondTimestamps = (bool) $micro;
 
  288        if (!$this->handlers) {
 
  292        $levelName = static::getLevelName($level);
 
  296        reset($this->handlers);
 
  297        while (
$handler = current($this->handlers)) {
 
  298            if (
$handler->isHandling(array(
'level' => $level))) {
 
  299                $handlerKey = key($this->handlers);
 
  303            next($this->handlers);
 
  306        if (
null === $handlerKey) {
 
  310        if (!static::$timezone) {
 
  311            static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 
'UTC');
 
  314        if ($this->microsecondTimestamps) {
 
  315            $ts = \DateTime::createFromFormat(
'U.u', 
sprintf(
'%.6F', microtime(
true)), static::$timezone);
 
  317            $ts = new \DateTime(
null, static::$timezone);
 
  319        $ts->setTimezone(static::$timezone);
 
  323            'context' => $context,
 
  325            'level_name' => $levelName,
 
  326            'channel' => $this->name,
 
  331        foreach ($this->processors as $processor) {
 
  332            $record = call_user_func($processor, $record);
 
  335        while (
$handler = current($this->handlers)) {
 
  336            if (
true === 
$handler->handle($record)) {
 
  340            next($this->handlers);
 
  367        return $this->addRecord(static::INFO, 
$message, $context);
 
  379        return $this->addRecord(static::NOTICE, 
$message, $context);
 
  391        return $this->addRecord(static::WARNING, 
$message, $context);
 
  403        return $this->addRecord(static::ERROR, 
$message, $context);
 
  415        return $this->addRecord(static::CRITICAL, 
$message, $context);
 
  427        return $this->addRecord(static::ALERT, 
$message, $context);
 
  439        return $this->addRecord(static::EMERGENCY, 
$message, $context);
 
  449        return array_flip(static::$levels);
 
  460        if (!isset(static::$levels[$level])) {
 
  461            throw new InvalidArgumentException(
'Level "'.$level.
'" is not defined, use one of: '.implode(
', ', array_keys(static::$levels)));
 
  464        return static::$levels[$level];
 
  475        if (is_string($level) && 
defined(__CLASS__.
'::'.strtoupper($level))) {
 
  476            return constant(__CLASS__.
'::'.strtoupper($level));
 
  494        foreach ($this->handlers as 
$handler) {
 
  495            if (
$handler->isHandling($record)) {
 
  515        $level = static::toMonologLevel($level);
 
  517        return $this->addRecord($level, 
$message, $context);
 
  545        return $this->addRecord(static::INFO, 
$message, $context);
 
  559        return $this->addRecord(static::NOTICE, 
$message, $context);
 
  573        return $this->addRecord(static::WARNING, 
$message, $context);
 
  587        return $this->addRecord(static::WARNING, 
$message, $context);
 
  601        return $this->addRecord(static::ERROR, 
$message, $context);
 
  615        return $this->addRecord(static::ERROR, 
$message, $context);
 
  629        return $this->addRecord(static::CRITICAL, 
$message, $context);
 
  643        return $this->addRecord(static::CRITICAL, 
$message, $context);
 
  657        return $this->addRecord(static::ALERT, 
$message, $context);
 
  671        return $this->addRecord(static::EMERGENCY, 
$message, $context);
 
  685        return $this->addRecord(static::EMERGENCY, 
$message, $context);
 
  697        self::$timezone = 
$tz;
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Stores to any stream resource.
addEmergency($message, array $context=array())
Adds a log record at the EMERGENCY level.
addRecord($level, $message, array $context=array())
Adds a log record.
emergency($message, array $context=array())
Adds a log record at the EMERGENCY level.
pushHandler(HandlerInterface $handler)
Pushes a handler on to the stack.
setHandlers(array $handlers)
Set handlers, replacing all existing ones.
warning($message, array $context=array())
Adds a log record at the WARNING level.
err($message, array $context=array())
Adds a log record at the ERROR level.
crit($message, array $context=array())
Adds a log record at the CRITICAL level.
pushProcessor($callback)
Adds a processor on to the stack.
static toMonologLevel($level)
Converts PSR-3 levels to Monolog ones if necessary.
useMicrosecondTimestamps($micro)
Control the use of microsecond resolution timestamps in the 'datetime' member of new records.
addInfo($message, array $context=array())
Adds a log record at the INFO level.
info($message, array $context=array())
Adds a log record at the INFO level.
static getLevelName($level)
Gets the name of the logging level.
log($level, $message, array $context=array())
Adds a log record at an arbitrary level.
notice($message, array $context=array())
Adds a log record at the NOTICE level.
debug($message, array $context=array())
Adds a log record at the DEBUG level.
popProcessor()
Removes the processor on top of the stack and returns it.
__construct($name, array $handlers=array(), array $processors=array())
static getLevels()
Gets all supported logging levels.
critical($message, array $context=array())
Adds a log record at the CRITICAL level.
addAlert($message, array $context=array())
Adds a log record at the ALERT level.
emerg($message, array $context=array())
Adds a log record at the EMERGENCY level.
isHandling($level)
Checks whether the Logger has a handler that listens on the given level.
alert($message, array $context=array())
Adds a log record at the ALERT level.
popHandler()
Pops a handler from the stack.
addDebug($message, array $context=array())
Adds a log record at the DEBUG level.
error($message, array $context=array())
Adds a log record at the ERROR level.
addError($message, array $context=array())
Adds a log record at the ERROR level.
addCritical($message, array $context=array())
Adds a log record at the CRITICAL level.
addNotice($message, array $context=array())
Adds a log record at the NOTICE level.
withName($name)
Return a new cloned instance with the name changed.
static setTimezone(\DateTimeZone $tz)
Set the timezone to be used for the timestamp of log records.
warn($message, array $context=array())
Adds a log record at the WARNING level.
addWarning($message, array $context=array())
Adds a log record at the WARNING level.
Interface that all Monolog Handlers must implement.
Describes a logger instance.
catch(Exception $e) $message
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'