Skip to content

Conversation

@AkshayBz
Copy link
Contributor

This will also serve as future reference for adding additional Raven Client params.

@dcramer
Copy link

dcramer commented Feb 26, 2016

This is probably a good default for the Sentry integration.

The primary issue here is also present in Laravel: exceptions aren't bubbled up appropriate to Sentry, therefore it can't create a reliable backtrace. Monolog (I think?) seems to stuff these into context, but that's not overly useful as its unstructured.

Ideally Sentry itself would just hook into Symfony (and Laravel) native error handlers, vs using a logging abstraction, but that may not be easily doable.

Also the primary caveat here is if the Monolog handler didn't immediately bubble this up to Sentry the backtrace would change and be incorrect. That is if it queued up messages for sending in some fashion.

@AkshayBz
Copy link
Contributor Author

@dcramer - That's true.
screen shot 2016-02-27 at 3 42 10 am
As you can see in the screenshot, out of the 12 entries in stacktrace, the top 4 are part of the Monolog code trace
PS: These additional entries are not seen if we provide exception in the context.

@AkshayBz
Copy link
Contributor Author

@stof - Please have a look

@Seldaek
Copy link
Member

Seldaek commented Mar 1, 2016

PR looks good to me but I have no knowledge about Sentry unfortunately.

Monolog (I think?) seems to stuff these into context, but that's not overly useful as its unstructured.

This is true, $msg['context']['exception'] is the recommended way to store Exception instances, as per PSR-3 so it is kinda structured or at least standardized.

If you two agree that this should be merged then I guess I'll do it. Let me know.

@AkshayBz
Copy link
Contributor Author

AkshayBz commented Mar 1, 2016

Please do merge the PR.
auto_log_stacks is definitely a useful option to have in Sentry.
I'll try a few things to improve Monolog's Sentry support. Will create another PR if the experiments succeed.

Seldaek added a commit that referenced this pull request Mar 2, 2016
Add `auto_log_stacks` param support for Sentry (Raven Client)
@Seldaek Seldaek merged commit d4d933a into symfony:master Mar 2, 2016
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

Successfully merging this pull request may close these issues.

3 participants