Skip to content

Commit

Permalink
Add PsrLogMessageProcessor to loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
GDXbsv committed Aug 3, 2022
1 parent cd4a10e commit 724a6b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Laravel/LaravelLoggerCreating.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -18,6 +19,8 @@

$s->set(Processor::class)
->tag('monolog.processor');
$s->set(PsrLogMessageProcessor::class)
->tag('monolog.processor');

$s->set(Formatter::class);

Expand Down

0 comments on commit 724a6b5

Please sign in to comment.