10000 Update Monolog email error via Symfony Mailer · noniagriconomie/symfony-docs@96c509d · GitHub
[go: up one dir, main page]

Skip to content

Commit 96c509d

Browse files
Update Monolog email error via Symfony Mailer
Related to symfony/monolog-bundle#354
1 parent 94048f9 commit 96c509d

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

logging/monolog_email.rst

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
How to Configure Monolog to Email Errors
55
========================================
66

7-
.. caution::
8-
9-
This feature is not compatible yet with the new :doc:`Symfony mailer </mailer>`,
10-
so it requires using SwiftMailer.
11-
127
`Monolog`_ can be configured to send an email when an error occurs within an
138
application. The configuration for this requires a few nested handlers
149
in order to avoid receiving too many emails. This configuration looks
@@ -33,9 +28,9 @@ it is broken down.
3328
handler: deduplicated
3429
deduplicated:
3530
type: deduplication
36-
handler: swift
37-
swift:
38-
type: swift_mailer
31+
handler: symfony_mailer
32+
symfony_mailer:
33+
type: symfony_mailer
3934
from_email: 'error@example.com'
4035
to_email: 'error@example.com'
4136
# or list of recipients
@@ -73,11 +68,11 @@ it is broken down.
7368
<monolog:handler
7469
name="deduplicated"
7570
type="deduplication"
76-
handler="swift"
71+
handler="symfony_mailer"
7772
/>
7873
<monolog:handler
79-
name="swift"
80-
type="swift_mailer"
74+
name="symfony_mailer"
75+
type="symfony_mailer"
8176
from-email="error@example.com"
8277
subject="An Error Occurred! %%message%%"
8378
level="debug"
@@ -114,10 +109,10 @@ it is broken down.
114109
],
115110
'deduplicated' => [
116111
'type' => 'deduplication',
117-
'handler' => 'swift',
112+
'handler' => 'symfony_mailer',
118113
],
119-
'swift' => [
120-
'type' => 'swift_mailer',
114+
'symfony_mailer' => [
115+
'type' => 'symfony_mailer',
121116
'from_email' => 'error@example.com',
122117
'to_email' => 'error@example.com',
123118
// or a list of recipients
@@ -162,7 +157,7 @@ You can adjust the time period using the ``time`` option:
162157
type: deduplication
163158
# the time in seconds during which duplicate entries are discarded (default: 60)
164159
time: 10
165-
handler: swift
160+
handler: symfony_mailer
166161
167162
.. code-block:: xml
168163
@@ -172,7 +167,7 @@ You can adjust the time period using the ``time`` option:
172167
<monolog:handler name="deduplicated"
173168
type="deduplication"
174169
time="10"
175-
handler="swift"/>
170+
handler="symfony_mailer"/>
176171
177172
.. code-block:: php
178173
@@ -184,12 +179,12 @@ You can adjust the time period using the ``time`` option:
184179
'type' => 'deduplication',
185180
// the time in seconds during which duplicate entries are discarded (default: 60)
186181
'time' => 10,
187-
'handler' => 'swift',
182+
'handler' => 'symfony_mailer',
188183
],
189184
],
190185
]);
191186
192-
The messages are then passed to the ``swift`` handler. This is the handler that
187+
The messages are then passed to the ``symfony_mailer`` handler. This is the handler that
193188
actually deals with emailing you the error. The settings for this are
194189
straightforward, the to and from addresses, the formatter, the content type
195190
and the subject.
@@ -217,9 +212,9 @@ get logged on the server as well as the emails being sent:
217212
level: debug
218213
deduplicated:
219214
type: deduplication
220-
handler: swift
221-
swift:
222-
type: swift_mailer
215+
handler: symfony_mailer
216+
symfony_mailer:
217+
type: symfony_mailer
223218
from_email: 'error@example.com'
224219
to_email: 'error@example.com'
225220
subject: 'An Error Occurred! %%message%%'
@@ -259,11 +254,11 @@ get logged on the server as well as the emails being sent:
259254
<monolog:handler
260255
name="deduplicated"
261256
type="deduplication"
262-
handler="swift"
257+
handler="symfony_mailer"
263258
/>
264259
<monolog:handler
265-
name="swift"
266-
type="swift_mailer"
260+
name="symfony_mailer"
261+
type="symfony_mailer"
267262
from-email="error@example.com"
268263
subject="An Error Occurred! %%message%%"
269264
level="debug"
@@ -303,10 +298,10 @@ get logged on the server as well as the emails being sent:
303298
],
304299
'deduplicated' => [
305300
'type' => 'deduplication',
306-
'handler' => 'swift',
301+
'handler' => 'symfony_mailer',
307302
],
308-
'swift' => [
309-
'type' => 'swift_mailer',
303+
'symfony_mailer' => [
304+
'type' => 'symfony_mailer',
310305
'from_email' => 'error@example.com',
311306
'to_email' => 'error@example.com',
312307
// or a list of recipients

0 commit comments

Comments
 (0)
0