@@ -25,18 +25,20 @@ it is broken down.
25
25
# action_level: error
26
26
# excluded_404s:
27
27
# - ^/
28
- handler : buffered
29
- buffered :
30
- type : buffer
28
+ handler : deduplicated
29
+ deduplicated :
30
+ type : deduplication
31
31
handler : swift
32
32
swift :
33
33
type : swift_mailer
34
34
from_email : ' error@example.com'
35
35
to_email : ' error@example.com'
36
36
# or list of recipients
37
37
# to_email: ['dev1@example.com', 'dev2@example.com', ...]
38
- subject : An Error Occurred!
38
+ subject : ' An Error Occurred! %%message%% '
39
39
level : debug
40
+ formatter : monolog.formatter.html
41
+ content_type : text/html
40
42
41
43
.. code-block :: xml
42
44
@@ -49,33 +51,36 @@ it is broken down.
49
51
http://symfony.com/schema/dic/monolog http://symfony.com/schema/dic/monolog/monolog-1.0.xsd" >
50
52
51
53
<monolog : config >
52
- <!--
53
- To also log 400 level errors (but not 404's):
54
+ <!--
55
+ 500 errors are logged at the critical level,
56
+ to also log 400 level errors (but not 404's):
54
57
action-level="error"
55
58
And add this child inside this monolog:handler
56
- <monolog:excluded-404>^/</monolog:excluded-404>
59
+ <monolog:excluded-404>^/</monolog:excluded-404>
57
60
-->
58
61
<monolog : handler
59
62
name =" mail"
60
63
type =" fingers_crossed"
61
64
action-level =" critical"
62
- handler =" buffered "
65
+ handler =" deduplicated "
63
66
/>
64
67
<monolog : handler
65
- name =" buffered "
66
- type =" buffer "
68
+ name =" deduplicated "
69
+ type =" deduplication "
67
70
handler =" swift"
68
- / >
71
+ >
69
72
<monolog : handler
70
73
name =" swift"
71
74
type =" swift_mailer"
72
75
from-email =" error@example.com"
73
- subject =" An Error Occurred!"
74
- level =" debug" >
76
+ subject =" An Error Occurred! %%message%%"
77
+ level =" debug"
78
+ formatter =" monolog.formatter.html"
79
+ content-type =" text/html" >
75
80
76
81
<monolog : to-email >error@example.com</monolog : to-email >
77
82
78
- <!-- or multiple to-email elements -->
83
+ <!-- or list of recipients -->
79
84
<!--
80
85
<monolog:to-email>dev1@example.com</monolog:to-email>
81
86
<monolog:to-email>dev2@example.com</monolog:to-email>
@@ -92,26 +97,29 @@ it is broken down.
92
97
'handlers' => array(
93
98
'mail' => array(
94
99
'type' => 'fingers_crossed',
100
+ // 500 errors are logged at the critical level
95
101
'action_level' => 'critical',
96
102
// to also log 400 level errors (but not 404's):
97
103
// 'action_level' => 'error',
98
104
// 'excluded_404s' => array(
99
105
// '^/',
100
106
// ),
101
- 'handler' => 'buffered ',
107
+ 'handler' => 'deduplicated ',
102
108
),
103
- 'buffered ' => array(
104
- 'type' => 'buffer ',
105
- 'handler' => 'swift',
109
+ 'duplicated ' => array(
110
+ 'type' => 'deduplication ',
111
+ 'handler' => 'swift'
106
112
),
107
113
'swift' => array(
108
- 'type' => 'swift_mailer',
109
- 'from_email' => 'error@example.com',
110
- 'to_email' => 'error@example.com',
114
+ 'type' => 'swift_mailer',
115
+ 'from_email' => 'error@example.com',
116
+ 'to_email' => 'error@example.com',
111
117
// or a list of recipients
112
118
// 'to_email' => array('dev1@example.com', 'dev2@example.com', ...),
113
- 'subject' => 'An Error Occurred!',
114
- 'level' => 'debug',
119
+ 'subject' => 'An Error Occurred! %%message%%',
120
+ 'level' => 'debug',
121
+ 'formatter' => 'monolog.formatter.html'
122
+ 'content_type' => 'text/html'
115
123
),
116
124
),
117
125
));
0 commit comments