4
4
How to Configure Monolog to Email Errors
5
5
========================================
6
6
7
- .. caution ::
7
+ .. versionadded :: 3.6
8
8
9
- This feature is not compatible yet with the new :doc: `Symfony mailer </mailer >`,
10
- so it requires using SwiftMailer .
9
+ Support for emailing errors using :doc: `Symfony mailer </mailer >` was added
10
+ in MonologBundle 3.6 .
11
11
12
12
`Monolog `_ can be configured to send an email when an error occurs within an
13
13
application. The configuration for this requires a few nested handlers
@@ -33,9 +33,9 @@ it is broken down.
33
33
handler : deduplicated
34
34
deduplicated :
35
35
type : deduplication
36
- handler : swift
37
- swift :
38
- type : swift_mailer
36
+ handler : symfony_mailer
37
+ symfony_mailer :
38
+ type : symfony_mailer
39
39
40
40
41
41
# or list of recipients
@@ -73,11 +73,11 @@ it is broken down.
73
73
<monolog : handler
74
74
name =" deduplicated"
75
75
type =" deduplication"
76
- handler =" swift "
76
+ handler =" symfony_mailer "
77
77
/>
78
78
<monolog : handler
79
- name =" swift "
80
- type =" swift_mailer "
79
+ name =" symfony_mailer "
80
+ type =" symfony_mailer "
81
81
82
82
subject =" An Error Occurred! %%message%%"
83
83
level =" debug"
@@ -114,10 +114,10 @@ it is broken down.
114
114
],
115
115
'deduplicated' => [
116
116
'type' => 'deduplication',
117
- 'handler' => 'swift ',
117
+ 'handler' => 'symfony_mailer ',
118
118
],
119
- 'swift ' => [
120
- 'type' => 'swift_mailer ',
119
+ 'symfony_mailer ' => [
120
+ 'type' => 'symfony_mailer ',
121
121
'from_email' => '[email protected] ',
122
122
'to_email' => '[email protected] ',
123
123
// or a list of recipients
@@ -162,7 +162,7 @@ You can adjust the time period using the ``time`` option:
162
162
type : deduplication
163
163
# the time in seconds during which duplicate entries are discarded (default: 60)
164
164
time : 10
165
- handler : swift
165
+ handler : symfony_mailer
166
166
167
167
.. code-block :: xml
168
168
@@ -172,7 +172,7 @@ You can adjust the time period using the ``time`` option:
172
172
<monolog : handler name =" deduplicated"
173
173
type =" deduplication"
174
174
time =" 10"
175
- handler =" swift " />
175
+ handler =" symfony_mailer " />
176
176
177
177
.. code-block :: php
178
178
@@ -184,12 +184,12 @@ You can adjust the time period using the ``time`` option:
184
184
'type' => 'deduplication',
185
185
// the time in seconds during which duplicate entries are discarded (default: 60)
186
186
'time' => 10,
187
- 'handler' => 'swift ',
187
+ 'handler' => 'symfony_mailer ',
188
188
],
189
189
],
190
190
]);
191
191
192
- The messages are then passed to the ``swift `` handler. This is the handler that
192
+ The messages are then passed to the ``symfony_mailer `` handler. This is the handler that
193
193
actually deals with emailing you the error. The settings for this are
194
194
straightforward, the to and from addresses, the formatter, the content type
195
195
and the subject.
@@ -217,9 +217,9 @@ get logged on the server as well as the emails being sent:
217
217
level : debug
218
218
deduplicated :
219
219
type : deduplication
220
- handler : swift
221
- swift :
222
- type : swift_mailer
220
+ handler : symfony_mailer
221
+ symfony_mailer :
222
+ type : symfony_mailer
223
223
224
224
225
225
subject : ' An Error Occurred! %%message%%'
@@ -259,11 +259,11 @@ get logged on the server as well as the emails being sent:
259
259
<monolog : handler
260
260
name =" deduplicated"
261
261
type =" deduplication"
262
- handler =" swift "
262
+ handler =" symfony_mailer "
263
263
/>
264
264
<monolog : handler
265
- name =" swift "
266
- type =" swift_mailer "
265
+ name =" symfony_mailer "
266
+ type =" symfony_mailer "
267
267
268
268
subject =" An Error Occurred! %%message%%"
269
269
level =" debug"
@@ -303,10 +303,10 @@ get logged on the server as well as the emails being sent:
303
303
],
304
304
'deduplicated' => [
305
305
'type' => 'deduplication',
306
- 'handler' => 'swift ',
306
+ 'handler' => 'symfony_mailer ',
307
307
],
308
- 'swift ' => [
309
- 'type' => 'swift_mailer ',
308
+ 'symfony_mailer ' => [
309
+ 'type' => 'symfony_mailer ',
310
310
'from_email' => '[email protected] ',
311
311
'to_email' => '[email protected] ',
312
312
// or a list of recipients
0 commit comments