【发布时间】:2019-12-18 23:54:39
【问题描述】:
我正在尝试从独白中排除 404 错误,以免在机器人抓取我的网站时发送垃圾邮件。 所以我尝试了这个文档:https://symfony.com/blog/new-in-symfony-4-1-ignore-specific-http-codes-from-logs,但如果我的网址不正确,我总是会收到来自 monolog 的 Slack ...
我做错了什么? 是错误的程度吗?
规格:
- Symfony 4.3.2
- 独白包^3.4
感谢您提供的任何帮助。
slack:
type: slack
token: '%env(SLACK_TOKEN)%'
channel: 'it-erreurs'
bot_name: 'Erreurs'
icon_emoji: ":heavy_check_mark:"
level: notice
channels: ['symfony']
include_extra: true
filter_for_errors:
type: fingers_crossed
action_level: notice
handler: file_log
excluded_http_codes: [403, 404, { 400: ['^/foo', '^/bar'] }]
file_log:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
deduplicated:
type: deduplication
handler: grouped
time: 30
grouped:
type: group
members: [slack, filter_for_errors]
【问题讨论】: