From 4d6b9be6edd455df88f319916978e6bb8f947ffe Mon Sep 17 00:00:00 2001 From: shkkmo Date: Thu, 16 Jun 2016 16:30:56 -0700 Subject: [PATCH 1/2] Clarify usage of handler channel configuration See: https://github.com/symfony/monolog-bundle/blob/master/DependencyInjection/MonologExtension.php#L88 I believe this applies to all versions of Symfony, so should be merged into the branches of documentation for all of them. --- cookbook/logging/channels_handlers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/logging/channels_handlers.rst b/cookbook/logging/channels_handlers.rst index d123e0d489f..446aa0fb28d 100644 --- a/cookbook/logging/channels_handlers.rst +++ b/cookbook/logging/channels_handlers.rst @@ -25,7 +25,7 @@ Switching a Channel to a different Handler Now, suppose you want to log the ``security`` channel to a different file. To do this, just create a new handler and configure it to log only messages -from the ``security`` channel. You might add this in ``config.yml`` to log +from the ``security`` channel. (This handler MUST be a top level handler, not a handler that is nested inside a Group, Buffer, Filter, or FingersCrossed Handler). You might add this in ``config.yml`` to log in all environments, or just ``config_prod.yml`` to happen only in ``prod``: .. configuration-block:: From 4b4ff3c410fa9af9f34ad18303e922c01071ca18 Mon Sep 17 00:00:00 2001 From: shkkmo Date: Mon, 20 Jun 2016 10:47:01 -0700 Subject: [PATCH 2/2] edit monolog channel documentation changes --- cookbook/logging/channels_handlers.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cookbook/logging/channels_handlers.rst b/cookbook/logging/channels_handlers.rst index 446aa0fb28d..40e9eef3349 100644 --- a/cookbook/logging/channels_handlers.rst +++ b/cookbook/logging/channels_handlers.rst @@ -25,7 +25,7 @@ Switching a Channel to a different Handler Now, suppose you want to log the ``security`` channel to a different file. To do this, just create a new handler and configure it to log only messages -from the ``security`` channel. (This handler MUST be a top level handler, not a handler that is nested inside a Group, Buffer, Filter, or FingersCrossed Handler). You might add this in ``config.yml`` to log +from the ``security`` channel. You might add this in ``config.yml`` to log in all environments, or just ``config_prod.yml`` to happen only in ``prod``: .. configuration-block:: @@ -95,6 +95,10 @@ in all environments, or just ``config_prod.yml`` to happen only in ``prod``: ), )); +.. caution:: + + The 'channels' configuration only works for top level handlers. Handlers that are nested inside a Group, Buffer, Filter, FingersCrossed, or other such Handler will ignore this configuration and will process every message passed to them. + YAML Specification ------------------