-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
refactor(log): store log in context so it's automatically propagated #1356
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1356 +/- ##
==========================================
+ Coverage 93.88% 94.24% +0.35%
==========================================
Files 78 78
Lines 6361 4933 -1428
==========================================
- Hits 5972 4649 -1323
+ Misses 300 194 -106
- Partials 89 90 +1 ☔ View full report in Codecov by Sentry. |
This looks nice |
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.
Just one question out of curiosity
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.
👍
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.
This looks like a positive change! 🎉 Just had one (unrelated) question
RFC 8484 Section 4.2.1: > A successful HTTP response with a 2xx status code (see > Section 6.3 of RFC7231) is used for any valid DNS response, > regardless of the DNS response code. For example, a successful 2xx > HTTP status code is used even with a DNS message whose DNS response > code indicates failure, such as SERVFAIL or NXDOMAIN. https://www.rfc-editor.org/rfc/rfc8484#section-4.2.1
b970b15
to
7d8f30f
Compare
As I had mentioned in #1264, this stores the logger in the
Context
we pass around during resolving. This helps better propagate log fields.The most user visible impact is
prefix
now contains more resolvers in the chain.There's also a new
req_id
field that's a unique ID per request which will making following logs during debug easier (related to #1307).I also changed
util.LogOnError
to get the log from a context, and removedmodel.Request.Log
.