diff --git a/src/Logs/Monolog/src/Handler.php b/src/Logs/Monolog/src/Handler.php index d4fc86f3..d718eb21 100644 --- a/src/Logs/Monolog/src/Handler.php +++ b/src/Logs/Monolog/src/Handler.php @@ -45,7 +45,9 @@ protected function getDefaultFormatter(): FormatterInterface */ protected function write($record): void { - $formatted = $record['formatted']; + $formatted = ($this->getFormatter() instanceof JsonFormatter) + ? json_decode($record['formatted'], true) + : $record['formatted']; $logRecord = (new API\LogRecord()) ->setTimestamp((int) $record['datetime']->format('Uu') * 1000) ->setSeverityNumber(API\Map\Psr3::severityNumber($record['level_name']))