]> git.mxchange.org Git - friendica.git/commitdiff
Set Timezone to 'UTC' for every Logger
authorPhilipp Holzer <admin@philipp.info>
Sat, 9 Mar 2019 13:28:31 +0000 (14:28 +0100)
committerPhilipp Holzer <admin@philipp.info>
Sat, 9 Mar 2019 13:28:31 +0000 (14:28 +0100)
src/Factory/LoggerFactory.php

index 681dc8a6c6bc5ce7fe3af5e00828f9feb8a92634..81c15bdb5bd4d311bdd3da6ae7fe95f0f5ebb138 100644 (file)
@@ -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());