Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 exception are still logged in sentry #24

Closed
allan-simon opened this issue Jan 7, 2021 · 6 comments
Closed

404 exception are still logged in sentry #24

allan-simon opened this issue Jan 7, 2021 · 6 comments

Comments

@allan-simon
Copy link

allan-simon commented Jan 7, 2021

I'm using symfony5.2 and version 1.2.2 of this bundle

my monolog.yaml looks like this

monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            handler: nested
            excluded_http_codes: [404, 405]
            buffer_size: 50 # How many messages should be saved? Prevent memory leaks
        nested:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
        console:
            type: console
            process_psr_3_messages: false
            channels: ["!event", "!doctrine"]

        sentry:
            type: fingers_crossed
            action_level: warning
            handler: sentry_buffer
            excluded_http_codes: [400, 401, 403, 404, 405]
            buffer_size: 100 # Prevents memory leaks for workers
            channels: ["!event", "!security"]
        sentry_buffer:
            type: buffer
            handler: sentry_handler
        sentry_handler:
            type: service
            id: 'BGalati\MonologSentryHandler\SentryHandler'

however despite the excluded_http_codes i still see the 40X errors sentry

I discovered this while trying to add exclude_404s https://symfony.com/doc/current/logging/monolog_regex_based_excludes.html to only filters out some 404 , i discovered that actually with the current configuration I should have any in the first place

@B-Galati
Copy link
Owner

B-Galati commented Jan 8, 2021

Could it be because you have the sentry default integration enabled ?

@allan-simon
Copy link
Author

thanks for your quick answer, maybe, where could I check that ?

@B-Galati
Copy link
Owner

B-Galati commented Jan 8, 2021

Start over, make sure you did not install the official Sentry Bundle https://github.com/getsentry/sentry-symfony.

Follow this guide https://github.com/B-Galati/monolog-sentry-handler/blob/master/doc/guide-symfony.md.

Otherwise make sure 'default_integrations' is set to false.

@allan-simon
Copy link
Author

thanks for the pointers, i'm checking that right now

@allan-simon
Copy link
Author

Indeed it was because I also had the sentry-symfony bundle installed, thanks a lot for your help

@B-Galati
Copy link
Owner

B-Galati commented Jan 8, 2021

Thanks, I am closing then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants