@@ -159,58 +159,6 @@ If you use several handlers, you can also register a processor at the
159159handler level or at the channel level instead of registering it globally
160160(see the following sections).
161161
162- .. tip ::
163-
164- .. versionadded :: 2.4
165- The autoconfiguration of Monolog processors was introduced in Monolog bundle 2.4.
166-
167- If you're using the :ref: `default services.yaml configuration <service-container-services-load-example >`,
168- processors implementing :class: `Monolog\\ Processor\\ ProcessorInterface `
169- are automatically registered as services and tagged with ``monolog.processor ``,
170- so you can use them without adding any configuration. The same applies to the
171- built-in :class: `Symfony\\ Bridge\\ Monolog\\ Processor\\ TokenProcessor ` and
172- :class: `Symfony\\ Bridge\\ Monolog\\ Processor\\ WebProcessor ` processors, which
173- can be enabled as follows:
174-
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);
213-
214162Registering Processors per Handler
215163----------------------------------
216164
0 commit comments