Symfony不记录弃用
问题描述:
我希望日志的行为像生产中的常规php-log。 有一个logrotate,服务器日志与其他工具进行分析。Symfony不记录弃用
所以,我建立了我的config_prod.yml这样的:
monolog:
use_microseconds: false
handlers:
main:
type: error_log
level: WARNING
deduplicated:
type: deduplication
time: 60
handler: main
不知何故,弃用(通过@trigger_error)出现在我的日志了。
我可以以某种方式禁用deprecations的日志记录吗? 我不需要他们在prod中,但只在开发。
亲切的问候。 帕特里克
答
你可以尝试从您的处理程序
use_microseconds: false
handlers:
main:
type: error_log
level: WARNING
deduplicated:
type: deduplication
time: 60
handler: main
channels: ['!php']
排除通道PHP是什么死在这里道是什么意思? – psren
我不知道如果不推荐通过通道PHP确定,但在我的项目中,我也使用了许多处理程序,并且我引用此文档以排除某些部分:https://symfony.com/doc/current/logging/channels_handlers.html – Mocrates