-
Notifications
You must be signed in to change notification settings - Fork 72
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 frontend logging #926
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dc243b6
to
b9ff0c4
Compare
b9ff0c4
to
0de128b
Compare
Please rebase pull request. |
0de128b
to
b86ccac
Compare
Please rebase pull request. |
b86ccac
to
79284aa
Compare
Please rebase pull request. |
79284aa
to
4f9150c
Compare
mbarnes
pushed a commit
that referenced
this pull request
Jan 14, 2025
Extracted from #926 to avoid conflicts. This commit will go away once 926 is merged.
Please rebase pull request. |
mbarnes
pushed a commit
that referenced
this pull request
Jan 15, 2025
Extracted from #926 to avoid conflicts. This commit will go away once 926 is merged.
LoggerFromContext will never fail now. Middleware functions were falling back to the default logger, but we do this from within LoggerFromContext now so the fallback logic doesn't have to be repeated everywhere.
Always retrieve the logger from the request context. This ensures we're using the correct logger in case middleware functions add a logging attribute.
Add a logger attribute for the request's "api-version" parameter from MiddlewareValidateAPIVersion. Also remove the "<api-version>: <function-name>" log messages from the HTTP handler methods. I added these messages when the handlers were no more than stubs to test request routing but they no longer add value to the frontend logs.
4f9150c
to
8c48526
Compare
mociarain
approved these changes
Jan 15, 2025
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.
Nice!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does
I wanted to make what I thought was a small change to the frontend logs (essentially the last commit here). But when I realized the logger attribute I added ("api_version") was not showing up in logs, the ensuing investigation led me down a rabbit hole that resulted in some major logging refactoring.
See the individual commit messages for more context.