Skip to content

Commit 56cc61e

Browse files
committed
minor #7896 How to change the 'time' parameter of the deduplication handler (ThomasLandauer, xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- How to change the 'time' parameter of the deduplication handler Don't know how this needs to be written in XML & PHP, sorry. Commits ------- 4b7bc67 Update monolog_email.rst da281f2 `time` option 9d2f2fd add XML and PHP config examples 25e0bc1 How to change the 'time' parameter of the deduplication handler
2 parents 7e3d02e + 4b7bc67 commit 56cc61e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

logging/monolog_email.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,43 @@ then passes them onto the nested handler in one go, but only if the records are
143143
unique over a given period of time (60 seconds by default). If the records are
144144
duplicates they are simply discarded. Adding this handler reduces the amount of
145145
notifications to a manageable level, specially in critical failure scenarios.
146+
You can adjust the time period:
147+
148+
.. configuration-block::
149+
150+
.. code-block:: yaml
151+
152+
# app/config/config_prod.yml
153+
monolog:
154+
handlers:
155+
# ...
156+
deduplicated:
157+
type: deduplication
158+
# the time in seconds during which duplicate entries are discarded (default: 60)
159+
time: 10
160+
handler: swift
161+
162+
.. code-block:: xml
163+
164+
<!-- app/config/config_prod.xml -->
165+
<!-- use the `time` attribute for values other than the default of 60 seconds: -->
166+
<monolog:handler name="deduplicated"
167+
type="deduplication"
168+
time="10"
169+
handler="swift" />
170+
171+
.. code-block:: php
172+
173+
// app/config/config_prod.php
174+
$container->loadFromExtension('monolog', array(
175+
'handlers' => array(
176+
// ...
177+
'deduplicated' => array(
178+
'type' => 'deduplication',
179+
// the time in seconds during which duplicate entries are discarded (default: 60)
180+
'time' => 10,
181+
'handler' => 'swift',
182+
)
146183
147184
The messages are then passed to the ``swift`` handler. This is the handler that
148185
actually deals with emailing you the error. The settings for this are

0 commit comments

Comments
 (0)