Browse Source

Set Timezone to 'UTC' for every Logger

pull/6837/head
Philipp Holzer 3 years ago
parent
commit
50b7d95b2a
No known key found for this signature in database GPG Key ID: 517BE60E2CE5C8A5
  1. 6
      src/Factory/LoggerFactory.php

6
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());

Loading…
Cancel
Save