From 50b7d95b2a819d589298dd07649d446fd400eae1 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sat, 9 Mar 2019 14:28:31 +0100 Subject: [PATCH] Set Timezone to 'UTC' for every Logger --- src/Factory/LoggerFactory.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Factory/LoggerFactory.php b/src/Factory/LoggerFactory.php index 681dc8a6c6..81c15bdb5b 100644 --- a/src/Factory/LoggerFactory.php +++ b/src/Factory/LoggerFactory.php @@ -40,6 +40,9 @@ class LoggerFactory */ public static function create($channel, Configuration $config) { + $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()); @@ -85,6 +88,9 @@ class LoggerFactory return null; } + $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()); -- 2.39.5