From dc2bda4f7a38bf7c3baccb6d331e145d1105aeeb Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 7 Aug 2018 11:34:15 +0200 Subject: [PATCH] add XML and PHP config examples --- logging/processors.rst | 46 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) 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 ----------------------------------