mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
Merge remote-tracking branch 'edsonmedina/master'
This commit is contained in:
@@ -229,23 +229,12 @@ class Logger implements LoggerInterface
|
||||
$this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
|
||||
}
|
||||
|
||||
if (!static::$timezone) {
|
||||
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
|
||||
}
|
||||
$levelName = static::getLevelName($level);
|
||||
|
||||
$record = array(
|
||||
'message' => (string) $message,
|
||||
'context' => $context,
|
||||
'level' => $level,
|
||||
'level_name' => static::getLevelName($level),
|
||||
'channel' => $this->name,
|
||||
'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone)->setTimezone(static::$timezone),
|
||||
'extra' => array(),
|
||||
);
|
||||
// check if any handler will handle this message
|
||||
$handlerKey = null;
|
||||
foreach ($this->handlers as $key => $handler) {
|
||||
if ($handler->isHandling($record)) {
|
||||
if ($handler->isHandling(array('level' => $level))) {
|
||||
$handlerKey = $key;
|
||||
break;
|
||||
}
|
||||
@@ -255,6 +244,20 @@ class Logger implements LoggerInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!static::$timezone) {
|
||||
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
|
||||
}
|
||||
|
||||
$record = array(
|
||||
'message' => (string) $message,
|
||||
'context' => $context,
|
||||
'level' => $level,
|
||||
'level_name' => $levelName,
|
||||
'channel' => $this->name,
|
||||
'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone)->setTimezone(static::$timezone),
|
||||
'extra' => array(),
|
||||
);
|
||||
|
||||
// found at least one, process message and dispatch it
|
||||
foreach ($this->processors as $processor) {
|
||||
$record = call_user_func($processor, $record);
|
||||
|
Reference in New Issue
Block a user