From a0f4a0a48b412deda2159dcce8ab07bfd3f0f3c1 Mon Sep 17 00:00:00 2001 From: Marcin Muszynski Date: Thu, 20 Dec 2018 14:58:26 +1100 Subject: [PATCH 1/2] Update processors.rst --- logging/processors.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/logging/processors.rst b/logging/processors.rst index e95ed2d16b3..a252abc343a 100644 --- a/logging/processors.rst +++ b/logging/processors.rst @@ -165,7 +165,7 @@ handler level or at the channel level instead of registering it globally The autoconfiguration of Monolog processors was introduced in Monolog bundle 2.4. If you're using the :ref:`default services.yaml configuration `, - processors implementing :class:`Monolog\\Processor\\ProcessorInterface` + processors implementing 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 @@ -298,3 +298,5 @@ the ``monolog.processor`` tag: $container ->register(SessionRequestProcessor::class) ->addTag('monolog.processor', array('channel' => 'main')); + +.. _ProcessorInterface: https://github.com/Seldaek/monolog/blob/master/src/Monolog/Processor/ProcessorInterface.php From 7119704c6f649d6f412b073cf0e1346b1c9e07b0 Mon Sep 17 00:00:00 2001 From: Marcin Muszynski Date: Fri, 21 Dec 2018 01:10:30 +1100 Subject: [PATCH 2/2] Remove the `ProcessorInterface` autoconfigure tip The `ProcessorInterface` changes were reverted from `symfony/symfony` (more info in #10483), so the tip doesn't seem to be truth, especially since mentioned processors (from https://github.com/symfony/monolog-bridge/blob/master/Processor/) don't even extend the `ProcessorInterface`. --- logging/processors.rst | 52 ------------------------------------------ 1 file changed, 52 deletions(-) diff --git a/logging/processors.rst b/logging/processors.rst index a252abc343a..e0a0b2b1ed0 100644 --- a/logging/processors.rst +++ b/logging/processors.rst @@ -159,58 +159,6 @@ 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:: 2.4 - The autoconfiguration of Monolog processors was introduced in Monolog bundle 2.4. - - If you're using the :ref:`default services.yaml configuration `, - processors implementing 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: - - .. 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 ----------------------------------