@@ -172,14 +172,44 @@ handler level or at the channel level instead of registering it globally
172
172
:class: `Symfony\\ Bridge\\ Monolog\\ Processor\\ WebProcessor ` processors, which
173
173
can be enabled as follows:
174
174
175
- .. code-block :: yaml
176
-
177
- # config/services.yaml
178
- services :
179
- # Adds the current security token to log entries
180
- Symfony\Bridge\Monolog\Processor\TokenProcessor : ~
181
- # Adds the real client IP to log entries
182
- Symfony\Bridge\Monolog\Processor\WebProcessor : ~
175
+ .. configuration-block ::
176
+
177
+ .. code-block :: yaml
178
+
179
+ # config/services.yaml
180
+ services :
181
+ # Adds the current security token to log entries
182
+ Symfony\Bridge\Monolog\Processor\TokenProcessor : ~
183
+ # Adds the real client IP to log entries
184
+ Symfony\Bridge\Monolog\Processor\WebProcessor : ~
185
+
186
+ .. code-block :: xml
187
+
188
+ <!-- config/services.xml -->
189
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
190
+ <container xmlns =" http://symfony.com/schema/dic/services"
191
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
192
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
193
+ http://symfony.com/schema/dic/services/services-1.0.xsd" >
194
+
195
+ <services >
196
+ <!-- Adds the current security token to log entries -->
197
+ <service id =" Symfony\Bridge\Monolog\Processor\TokenProcessor" />
198
+ <!-- Adds the real client IP to log entries -->
199
+ <service id =" Symfony\Bridge\Monolog\Processor\WebProcessor" />
200
+ </services >
201
+ </container >
202
+
203
+ .. code-block :: php
204
+
205
+ // config/services.php
206
+ use Symfony\Bridge\Monolog\Processor\TokenProcessor;
207
+ use Symfony\Bridge\Monolog\Processor\WebProcessor;
208
+
209
+ // Adds the current security token to log entries
210
+ $container->register(TokenProcessor::class);
211
+ // Adds the real client IP to log entries
212
+ $container->register(WebProcessor::class);
183
213
184
214
Registering Processors per Handler
185
215
----------------------------------
0 commit comments