Conversation
Context is provided by logger name. In this context repeating the word `request` is redundant and keys can be simplified and shortened to reduce log volume.
To allow for grouping of access logs per endpoint, add the matched URI pattern to the access log KVP. The path variables are NOT included in the KVP as they would duplicate the MDC content most of the time.
Left over from access log level strategy abstraction
gbenadikar
approved these changes
Mar 18, 2025
This file contains hidden or 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
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.
Refactor access logs KVP for more legible and more useful logs, allowing grouping of logs per endpoint to compute fine grained performance stats.
Sample of new format:
{ "timestamp": 1742294576376, "level": "INFO", "threadName": "http-nio-4452-exec-2", "loggerName": "app.quickcase.sdk.spring.logging.AccessLogFilter", "mdc": { "traceId": "9e89ed02-3c16-4b37-a9ac-8a02ca8953b4", "reference": "1727780880109118", "event": "39" }, "message": "Request processed (200) in 366ms: GET \/cases\/1727780880109118\/events\/39", "kvp": { "duration": "366", "method": "GET", "match": "\/cases\/{caseReference}\/events\/{id}", "uri": "\/cases\/1727780880109118\/events\/39", "status": "200" } }