From 724a6b5a0eb641684fa5ae0bab658f8933e143da Mon Sep 17 00:00:00 2001 From: "sergei.baikin" Date: Wed, 3 Aug 2022 13:18:40 +0200 Subject: [PATCH] Add PsrLogMessageProcessor to loggers --- src/Laravel/LaravelLoggerCreating.php | 2 ++ src/Symfony/config/services.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/Laravel/LaravelLoggerCreating.php b/src/Laravel/LaravelLoggerCreating.php index 4cdb50b..2760b12 100644 --- a/src/Laravel/LaravelLoggerCreating.php +++ b/src/Laravel/LaravelLoggerCreating.php @@ -12,6 +12,7 @@ use Illuminate\Support\Facades\App; use Monolog\Handler\StreamHandler; use Monolog\Logger; +use Monolog\Processor\PsrLogMessageProcessor; use NewRelic\Monolog\Enricher\Processor; final class LaravelLoggerCreating @@ -30,6 +31,7 @@ public function __invoke(array $config) $log = new Logger($channel); $log->pushProcessor(new Processor()); + $log->pushProcessor(new PsrLogMessageProcessor()); foreach ($processors as $processor) { $log->pushProcessor($processor); diff --git a/src/Symfony/config/services.php b/src/Symfony/config/services.php index 39e7a1c..4bfd2a5 100644 --- a/src/Symfony/config/services.php +++ b/src/Symfony/config/services.php @@ -5,6 +5,7 @@ use Gotphoto\Logging\ExceptionContext\AwsExceptionContext; use Gotphoto\Logging\ExceptionContext\GuzzleRequestExceptionContext; use Gotphoto\Logging\Formatter; +use Monolog\Processor\PsrLogMessageProcessor; use NewRelic\Monolog\Enricher\Processor; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; @@ -18,6 +19,8 @@ $s->set(Processor::class) ->tag('monolog.processor'); + $s->set(PsrLogMessageProcessor::class) + ->tag('monolog.processor'); $s->set(Formatter::class);