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

Errors are displayed in Sentry but not anymore logged in server's logs #652

Closed
AppyGG opened this issue Aug 19, 2022 · 5 comments
Closed

Comments

@AppyGG
Copy link

AppyGG commented Aug 19, 2022

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
symfony 5.4
sentry/sentry-symfony 4.3.0
sentry/sentry 3.7.0
sentry/sdk 3.2.0

Steps to Reproduce

Hello,
when an error is thrown by my app, for example a semicolon is missing at the end of a line, the app throws an error 500. This error is catched by Sentry and appears in my sentry.io dashboard, great. But the error page displayed in the user's browser is a basic error 500 page (screenshot below) and there is no logs in my prod.log file.
When i manually throw an error (by using the snippet in the documentation for testing ) it's working great. It seems like that manually thrown errors are ok, but other errors are not correctly managed.

Configs :

# config/packages/sentry.yml
when@prod:
    sentry:
        dsn: '%env(SENTRY_DSN)%'

I have an older version of my app with running with the same config except older dependencies versions :
sentry/sentry-symfony 4.2.5
sentry/sentry 3.3.5
sentry/sdk 3.1.1

With theses version, if an error occurs, the custom error page is used, i have a log in my prod.log and Sentry receive error details.

Expected Result

Something is logged in the prod.log and most important, custom twig errors templates are used to format response to user's browser.

Actual Result

Base Symfony error message :
image

@Jean85
Copy link
Collaborator

Jean85 commented Aug 22, 2022

This is another issue that would be solved by #337.

It's possible that your app config is somewhat messing with Symfony's error handler, so I don't think we can do anything here... Can you delve a bit deeper in the stacktrace?

@AppyGG AppyGG changed the title Error are displayed in Sentry but not anymore logged in server's logs Errors are displayed in Sentry but not anymore logged in server's logs Aug 22, 2022
@AppyGG
Copy link
Author

AppyGG commented Aug 22, 2022

This is another issue that would be solved by #337.

It's possible that your app config is somewhat messing with Symfony's error handler, so I don't think we can do anything here... Can you delve a bit deeper in the stacktrace?

Ok thank you, i will take a closer look at the difference between both stack trace and give you an update 👍

@github-actions
Copy link

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@AppyGG
Copy link
Author

AppyGG commented Sep 19, 2022

Hello, i played a little with available configuration options and found one that let events go through other handlers as well as Sentry.

Working configuration in config/packages/sentry.yaml

when@prod:
    sentry:
        dsn: '%env(SENTRY_DSN)%'
        register_error_listener: false

        options:
            default_integrations: false
            integrations: [ ]

    monolog:
        handlers:
            sentry:
                type: sentry
                level: !php/const Monolog\Logger::CRITICAL
                hub_id: Sentry\State\HubInterface

Now error pages are correctly rendered and event are logged in log files as well as sent to Sentry.
But Sentry now create 2 issues and has less context / data to work with.

  • One is created with logger=monolog.request
  • The second is created with logger=monolog.php

@github-actions
Copy link

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

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

4 participants