我在Monolog
中使用Symfony2
,现在以这种方式配置:
services:
monolog.formatter.html:
class: Monolog\Formatter\HtmlFormatter
monolog:
handlers:
main:
type: fingers_crossed
action_level: critical
handler: swift
handler: grouped
grouped:
type: group
members: [streamed, buffered]
streamed:
type: stream
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
buffered:
type: buffer
handler: swift
swift:
type: swift_mailer
from_email: 'email@gmail.com'
to_email: 'email@gmail.com'
subject: An Error Occurred!
level: debug
content_type: text/html
formatter: monolog.formatter.html
现在它向我发送有关我网站上所有活动的信息。如何配置它,仅接收有关异常的消息?
此外,我应该抓住的大多数例外和电子邮件来自guzzle库。类似(客户端错误响应)