-
Notifications
You must be signed in to change notification settings - Fork 32
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
Setup rails for JSON logging #1568
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1568 +/- ##
==========================================
+ Coverage 77.02% 77.03% +0.01%
==========================================
Files 611 611
Lines 46000 46026 +26
Branches 800 802 +2
==========================================
+ Hits 35431 35456 +25
- Misses 10481 10482 +1
Partials 88 88
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
end | ||
username ||= 'anonymous' | ||
payload = log.payload | ||
if payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the payload get set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comes from the semantic logging gem changing Rails.
end | ||
# This happens for a seperate exception log entry which we want to not include the backtrace a second time | ||
if log.exception | ||
message = "Exception was raised - #{log.exception.class}:#{log.exception.message}" unless message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't log.message always set? So this will never be set? Also do we want the exception message to override the passed message? Seems like an exception is more important ... I'm not sure how log.exception even gets set though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not always. I found for some exception logs they just include the exception object, not a message.
data[:message] = message if message | ||
data[:type] = type if type | ||
data[:url] = url if url | ||
data = data.merge(other) if other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure we don't overlap keys in other but I think we control the complete other hash so it should be ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We control other, so are capable of not reusing any names.
Quality Gate passedIssues Measures |
@ryanmelt do we need to make any equivalent Python code changes here? I see you added |
No description provided.