我正在使用symfony2处理项目,我将其上传到网络上,并将其从开发模式转换为prod模式,我已经完成了一些测试,当我遇到异常时,它发送了3O封电子邮件我的收件箱,有我的config_prod代码: 注意:我使用monolog进行日志记录
imports:
- { resource: config.yml }
#framework:
# validation:
# cache: apc
doctrine:
orm:
metadata_cache_driver: apc
result_cache_driver: apc
query_cache_driver: apc
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: grouped
grouped:
type: group
members: [streamed, swift]
streamed:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
swift:
type: swift_mailer
from_email: FQN@foo.com
to_email: a.krachli@improvia-maroc.com
subject: "GESTIBAT::Error_Exception"
level: debug
login:
type: stream
path: "%kernel.logs_dir%/auth.log"
level: info
channels: security
如果有人有想法,谢谢你的帮助!
答案 0 :(得分:0)
您应该在发送消息之前缓冲记录器消息,如symfony2 documentation
中所述buffered:
type: buffer
handler: swift