mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-23 21:33:25 +02:00
Deferred timezone creation
This commit is contained in:
@@ -109,10 +109,6 @@ class Logger implements LoggerInterface
|
||||
public function __construct($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
if (!static::$timezone) {
|
||||
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +183,11 @@ class Logger implements LoggerInterface
|
||||
if (!$this->handlers) {
|
||||
$this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
|
||||
}
|
||||
|
||||
if (!static::$timezone) {
|
||||
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
|
||||
}
|
||||
|
||||
$record = array(
|
||||
'message' => (string) $message,
|
||||
'context' => $context,
|
||||
|
Reference in New Issue
Block a user