Skip to content

Commit da281f2

Browse files
1 parent 9d2f2fd commit da281f2

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

logging/monolog_email.rst

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ it is broken down.
2828
handler: deduplicated
2929
deduplicated:
3030
type: deduplication
31-
# uncomment this line for values other than 60 seconds:
32-
# time: 10
3331
handler: swift
3432
swift:
3533
type: swift_mailer
@@ -154,6 +152,43 @@ then passes them onto the nested handler in one go, but only if the records are
154152
unique over a given period of time (60 seconds by default). If the records are
155153
duplicates they are simply discarded. Adding this handler reduces the amount of
156154
notifications to a manageable level, specially in critical failure scenarios.
155+
You can adjust the time period:
156+
157+
.. configuration-block::
158+
159+
.. code-block:: yaml
160+
161+
# app/config/config_prod.yml
162+
monolog:
163+
handlers:
164+
# ...
165+
deduplicated:
166+
type: deduplication
167+
# the time in seconds during which duplicate entries are discarded (default: 60)
168+
time: 10
169+
handler: swift
170+
171+
.. code-block:: xml
172+
173+
<!-- app/config/config_prod.xml -->
174+
<!-- use the `time` attribute for values other than the default of 60 seconds: -->
175+
<monolog:handler name="deduplicated"
176+
type="deduplication"
177+
time="10"
178+
handler="swift" />
179+
180+
.. code-block:: php
181+
182+
// app/config/config_prod.php
183+
$container->loadFromExtension('monolog', array(
184+
'handlers' => array(
185+
// ...
186+
'deduplicated' => array(
187+
'type' => 'deduplication',
188+
// the time in seconds during which duplicate entries are discarded (default: 60)
189+
'time' => 10,
190+
'handler' => 'swift',
191+
)
157192
158193
The messages are then passed to the ``swift`` handler. This is the handler that
159194
actually deals with emailing you the error. The settings for this are

0 commit comments

Comments
 (0)