Set Timezone to 'UTC' for every Logger (Develop)
This commit is contained in:
parent
2d263b08e3
commit
d03dedee63
2 changed files with 4 additions and 1 deletions
|
@ -135,6 +135,9 @@ class LoggerFactory
|
|||
switch ($config->get('system', 'logger_config', 'stream')) {
|
||||
|
||||
case 'monolog':
|
||||
$loggerTimeZone = new \DateTimeZone('UTC');
|
||||
Monolog\Logger::setTimezone($loggerTimeZone);
|
||||
|
||||
$logger = new Monolog\Logger($channel);
|
||||
$logger->pushProcessor(new Monolog\Processor\PsrLogMessageProcessor());
|
||||
$logger->pushProcessor(new Monolog\Processor\ProcessIdProcessor());
|
||||
|
|
|
@ -134,7 +134,7 @@ class StreamLogger extends AbstractLogger
|
|||
$record = array_merge($record, ['uid' => $this->logUid, 'process_id' => $this->pid]);
|
||||
$logMessage = '';
|
||||
|
||||
$logMessage .= DateTimeFormat::localNow() . ' ';
|
||||
$logMessage .= DateTimeFormat::utcNow() . ' ';
|
||||
$logMessage .= $this->channel . ' ';
|
||||
$logMessage .= '[' . strtoupper($level) . ']: ';
|
||||
$logMessage .= $this->psrInterpolate($message, $context) . ' ';
|
||||
|
|
Loading…
Reference in a new issue