diff --git a/logging/processors.rst b/logging/processors.rst index d78bd00457f..e9199417e5f 100644 --- a/logging/processors.rst +++ b/logging/processors.rst @@ -159,6 +159,28 @@ If you use several handlers, you can also register a processor at the handler level or at the channel level instead of registering it globally (see the following sections). +.. tip:: + + .. versionadded:: 4.2 + The autoconfiguration of Monolog processors was introduced in Symfony 4.2. + + If you're using the :ref:`default services.yaml configuration `, + processors implementing :class:`Symfony\\Bridge\\Monolog\\Processor\\ProcessorInterface` + are automatically registered as services and tagged with ``monolog.processor``, + so you can use them without adding any configuration. The same applies to the + built-in :class:`Symfony\\Bridge\\Monolog\\Processor\\TokenProcessor` and + :class:`Symfony\\Bridge\\Monolog\\Processor\\WebProcessor` processors, which + can be enabled as follows: + + .. code-block:: yaml + + # config/services.yaml + services: + # Adds the current security token to log entries + Symfony\Bridge\Monolog\Processor\TokenProcessor: ~ + # Adds the real client IP to log entries + Symfony\Bridge\Monolog\Processor\WebProcessor: ~ + Registering Processors per Handler ---------------------------------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy