Set Timezone to 'UTC' for every Logger

2022.09-rc
Philipp Holzer 2019-03-09 14:28:31 +01:00
rodzic af77af0446
commit 50b7d95b2a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 517BE60E2CE5C8A5
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

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