diff --git a/logging/processors.rst b/logging/processors.rst index d2ed250ac34..763723d93c2 100644 --- a/logging/processors.rst +++ b/logging/processors.rst @@ -172,14 +172,44 @@ handler level or at the channel level instead of registering it globally :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: ~ + .. configuration-block:: + + .. 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: ~ + + .. code-block:: xml + + + + + + + + + + + + + + .. code-block:: php + + // config/services.php + use Symfony\Bridge\Monolog\Processor\TokenProcessor; + use Symfony\Bridge\Monolog\Processor\WebProcessor; + + // Adds the current security token to log entries + $container->register(TokenProcessor::class); + // Adds the real client IP to log entries + $container->register(WebProcessor::class); Registering Processors per Handler ----------------------------------