-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
[Monolog] Handler not including context #870
Comments
This has already been discussed in #848 and #844 and reasons have been explained about why we won't support anymore out-of-the-box blindly setting what is in the context and/or in the |
Good stuff, I will check it out. Closing then. |
seems like this feature is supported now. in symfony sentry bundle with following config worked:
for more info you can check |
We have many log calls that are structured in the suggested way, i.e. context is an array with arbitrary fields:
Up until this week, we were still using Sentry 1.10 and the deprecated handler from Monolog upstream. The handler was configured with a LineFormatter and the line format
%message% %context% %extra%
. Sentry received messages like:Now we upgraded to Sentry 2.x and switched to the
Sentry\Monolog\Handler
. The message is now:The context is missing and also cannot be found under "Additional Data". Looking in the source of the integrated handler, the reasons become clear:
l. 49
: The Sentry fieldmessage
ist set using the Monolog fieldmessage
, which ignores theformatted
field set by the LineFormatter.The old behavior with the context added to the message as JSON object was not ideal, because Sentry would have had a hard time automatically merging the issues, resulting in many separate issues that needed manual merging. Therefore I would send a PR that adds the arbitrary context fields to the Sentry scope via
setExtra
.The text was updated successfully, but these errors were encountered: