Skip to content
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

Access logs are written within the Request Context #5500

Merged
merged 2 commits into from Mar 26, 2024

Conversation

jrhee17
Copy link
Contributor

@jrhee17 jrhee17 commented Mar 13, 2024

Motivation:

It is a common use case to use RequestContextExportingAppender together with AccessLogWriter. However, in order for RequestContextExportingAppender to work, the RequestContext must be available.

final RequestContext ctx = RequestContext.currentOrNull();

For this reason, I propose that config.accessLogWriter()::log be called with the RequestContext set on the calling thread

Modifications:

  • Searched all references of config.accessLogWriter()::log and wrapped in a ctx.push call.

Result:

  • access logs are written with the RequestContext set on the calling thread.

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.03%. Comparing base (4bfa172) to head (7ac7009).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5500       +/-   ##
===========================================
+ Coverage        0   74.03%   +74.03%     
- Complexity      0    20797    +20797     
===========================================
  Files           0     1801     +1801     
  Lines           0    76577    +76577     
  Branches        0     9759     +9759     
===========================================
+ Hits            0    56694    +56694     
- Misses          0    15260    +15260     
- Partials        0     4623     +4623     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jrhee17 jrhee17 added this to the 1.28.0 milestone Mar 14, 2024
@jrhee17 jrhee17 marked this pull request as ready for review March 14, 2024 08:16
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍

@jrhee17 jrhee17 merged commit 0ab1721 into line:main Mar 26, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants