File tree 1 file changed +15
-0
lines changed
Filter options
1 file changed +15
-0
lines changed
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bundle \MonologBundle \DependencyInjection ;
13
13
14
+ use Monolog \Processor \ProcessorInterface ;
15
+ use Symfony \Bridge \Monolog \Processor \TokenProcessor ;
16
+ use Symfony \Bridge \Monolog \Processor \WebProcessor ;
14
17
use Symfony \Component \HttpKernel \DependencyInjection \Extension ;
15
18
use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
16
19
use Symfony \Component \DependencyInjection \ContainerBuilder ;
@@ -108,6 +111,18 @@ public function load(array $configs, ContainerBuilder $container)
108
111
}
109
112
110
113
$ 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
+ }
111
126
}
112
127
113
128
/**
You can’t perform that action at this time.
0 commit comments