【发布时间】:2018-04-30 02:34:55
【问题描述】:
我注意到当我抛出 BadRequestHttpException 时,它会被 Monolog 记录。
如何从我的日志中排除特定异常和 HTTP 错误?我的配置如下:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_404s:
- ^/
nested:
type: rotating_file
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
max_files: 30
由于这是一个 API 网站,我有很多不应记录的“好”400 错误。
注意:我不想将级别提高到严重。
【问题讨论】:
-
哼400不好!
-
相关Github问题:github.com/symfony/monolog-bundle/issues/89