Skip to content

How to change the 'time' parameter of the deduplication handler #7896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions logging/monolog_email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,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

<!-- app/config/config_prod.xml -->
<!-- use the `time` attribute for values other than the default of 60 seconds: -->
<monolog:handler name="deduplicated"
type="deduplication"
time="10"
handler="swift" />

.. 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
Expand Down