From 25e0bc1070b5c410da3ed24ff754264733ed3ef8 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 10 May 2017 23:12:38 +0200 Subject: [PATCH 1/4] How to change the 'time' parameter of the deduplication handler Don't know how this needs to be written in XML & PHP, sorry. --- logging/monolog_email.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logging/monolog_email.rst b/logging/monolog_email.rst index c7c4f773351..892f98a83da 100644 --- a/logging/monolog_email.rst +++ b/logging/monolog_email.rst @@ -28,6 +28,8 @@ it is broken down. handler: deduplicated deduplicated: type: deduplication + # uncomment this line for values other than 60 seconds: + # time: 10 handler: swift swift: type: swift_mailer From 9d2f2fd9df136b63275e0ce991196e9dda213f7d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 12 May 2017 16:33:10 +0200 Subject: [PATCH 2/4] add XML and PHP config examples --- logging/monolog_email.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/logging/monolog_email.rst b/logging/monolog_email.rst index 892f98a83da..b10e922424d 100644 --- a/logging/monolog_email.rst +++ b/logging/monolog_email.rst @@ -66,6 +66,14 @@ it is broken down. action-level="critical" handler="deduplicated" /> + array( 'type' => 'deduplication', + // uncomment this line for values other than 60 seconds: + // 'time' => 10, 'handler' => 'swift', ), 'swift' => array( From da281f26bf9e5a03034a91a08166ba2e3c0b5304 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 25 Jul 2017 18:34:00 +0200 Subject: [PATCH 3/4] `time` option As suggested by https://github.com/symfony/symfony-docs/pull/7896#pullrequestreview-38006819 XML and PHP syntax is taken from https://github.com/symfony/symfony-docs/pull/7896/files/9d2f2fd9df136b63275e0ce991196e9dda213f7d --- logging/monolog_email.rst | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/logging/monolog_email.rst b/logging/monolog_email.rst index b10e922424d..2c53d3928c8 100644 --- a/logging/monolog_email.rst +++ b/logging/monolog_email.rst @@ -28,8 +28,6 @@ it is broken down. handler: deduplicated deduplicated: type: deduplication - # uncomment this line for values other than 60 seconds: - # time: 10 handler: swift swift: type: swift_mailer @@ -154,6 +152,43 @@ then passes them onto the nested handler in one go, but only if the records are unique over a given period of time (60 seconds by default). If the records are duplicates they are simply discarded. Adding this handler reduces the amount of notifications to a manageable level, specially in critical failure scenarios. +You can adjust the time period: + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/config_prod.yml + monolog: + handlers: + # ... + deduplicated: + type: deduplication + # the time in seconds during which duplicate entries are discarded (default: 60) + time: 10 + handler: swift + + .. code-block:: xml + + + + + + .. code-block:: php + + // app/config/config_prod.php + $container->loadFromExtension('monolog', array( + 'handlers' => array( + // ... + 'deduplicated' => array( + 'type' => 'deduplication', + // the time in seconds during which duplicate entries are discarded (default: 60) + 'time' => 10, + 'handler' => 'swift', + ) The messages are then passed to the ``swift`` handler. This is the handler that actually deals with emailing you the error. The settings for this are From 4b7bc67e86abb63c3a7670413d8f90429d4d4ef9 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 25 Jul 2017 18:36:53 +0200 Subject: [PATCH 4/4] Update monolog_email.rst Removing the now obsolete comments of https://github.com/symfony/symfony-docs/pull/7896/files/9d2f2fd9df136b63275e0ce991196e9dda213f7d --- logging/monolog_email.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/logging/monolog_email.rst b/logging/monolog_email.rst index 2c53d3928c8..701e8bb14c6 100644 --- a/logging/monolog_email.rst +++ b/logging/monolog_email.rst @@ -64,14 +64,6 @@ it is broken down. action-level="critical" handler="deduplicated" /> - array( 'type' => 'deduplication', - // uncomment this line for values other than 60 seconds: - // 'time' => 10, 'handler' => 'swift', ), 'swift' => array(