I'm trying to exclude 404 errors from monolog to not be spammed if robots crawl my website. So I tried this documentation : https://symfony.com/blog/new-in-symfony-4-1-ignore-specific-http-codes-from-logs, but if I'm going on an incorrect url, I'm always receiving a Slack from monolog ...
what am I doing wrong ? Is it the level of error ?
Specifications :
- Symfony 4.3.2
- monolog-bundle ^3.4
Thank you for any help you can offer.
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]