-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Fix :crash_reason metadata handling #533
Conversation
@mitchellhenke Thank you for your great work!! Could you review this PR? |
@sl0thentr0py thx for your reply and following comment.
I fixed my 1st comment to explain the purpose of this PR. |
I tried, but could not satisfy here is the example of meta from, test "includes Logger.metadata for keys configured to be included"
|
I'll need to think about this too, not that familiar with elixir. But we need some kind of general |
It might be. It would be nice to be able to make changes in a direction that is consistent with the current source, but I just can't take the time to do to that. |
Use case
This PR fixes following use case with
config :logger, Sentry.LoggerBackend, metadata: [:crash_reason]
.Currently we cannot log for other backends and Sentry.LoggerBackend at the same time with one line.
So we need to write like following,
Why cannot currently
The following code in the current master branch cannot work because it fails to encode JSON.
Because the :crash_reason value is a tuple.
sentry-elixir/lib/sentry/logger_backend.ex
Lines 101 to 102 in 0e238fe
:crash_reason is special metadata, so I think we don't need to use it for
:logger_metadata
in:extra
.