Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

excluded_http_codes might not work properly #271

Copy link
Copy link
Closed
@Sengorius

Description

@Sengorius
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.1

I'm currently using monolog to get informed about errors from a multi-user-site. For my current setup I used https://symfony.com/blog/new-in-symfony-4-1-ignore-specific-http-codes-from-logs as resource.

As you can see below, I tried to exclude 403 and 404 errors (especially) from mailing handler. As for all 404 it might work, but I'm still receiving mails on any 403 error.

# config/packages/prod/monolog.yaml
monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            handler: grouped
            excluded_http_codes: [403, 404]

        grouped:
            type: group
            members: [nested, mailer]

        nested:
            type: rotating_file
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            max_files: 30

        mailer:
            type: deduplication
            handler: swift_mail

        swift_mail:
            type: swift_mailer
            from_email: '%env(MAILER_DEFAULT_MAIL)%'
            to_email: '%env(MAILER_SERVICE_MAIL)%'
            subject: 'Exception in M-OBS: %%message%%'
            level: debug
            formatter: monolog.formatter.html
            content_type: text/html
            excluded_http_codes: [403, 404]

        console:
            type: console
            process_psr_3_messages: false
            channels: ["!event", "!doctrine"]

Can you please fix this or is it my error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.