Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7fdda67

Browse filesBrowse files
Register processors for autoconfiguration
1 parent 51cb54c commit 7fdda67
Copy full SHA for 7fdda67

File tree

1 file changed

+15
-0
lines changed
Filter options

1 file changed

+15
-0
lines changed

‎DependencyInjection/MonologExtension.php

Copy file name to clipboardExpand all lines: DependencyInjection/MonologExtension.php
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
namespace Symfony\Bundle\MonologBundle\DependencyInjection;
1313

14+
use Monolog\Processor\ProcessorInterface;
15+
use Symfony\Bridge\Monolog\Processor\TokenProcessor;
16+
use Symfony\Bridge\Monolog\Processor\WebProcessor;
1417
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
1518
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1619
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -108,6 +111,18 @@ public function load(array $configs, ContainerBuilder $container)
108111
}
109112

110113
$container->setParameter('monolog.additional_channels', isset($config['channels']) ? $config['channels'] : array());
114+
115+
if (method_exists($container, 'registerForAutoconfiguration')) {
116+
if (interface_exists(ProcessorInterface::class)) {
117+
$container->registerForAutoconfiguration(ProcessorInterface::class)
118+
->addTag('monolog.processor');
119+
} else {
120+
$container->registerForAutoconfiguration(WebProcessor::class)
121+
->addTag('monolog.processor');
122+
}
123+
$container->registerForAutoconfiguration(TokenProcessor::class)
124+
->addTag('monolog.processor');
125+
}
111126
}
112127

113128
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.