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

Enrich MDC with request method and request URI #771

Merged

Conversation

nscuro
Copy link
Collaborator

@nscuro nscuro commented Feb 26, 2025

Logs emitted during request handling can be ambiguous if a resource class contains many methods.

Access control failure logs are harder to interpret without the additional context of which endpoint was attempted to be accessed.

This change enriches the logger's MDC with both the request method, and the request URI.

If an endpoint accepts path parameters, the requestUri MDC variable will only contain the respective placeholder, not the parameter values themselves. This keeps values constant, making it easier to filter through logs.

@nscuro nscuro added this to the 3.2.0 milestone Feb 26, 2025
Logs emitted during request handling can be ambiguous if a resource class contains many methods.

Access control failure logs are harder to interpret without the additional context of which endpoint was attempted to be accessed.

This change enriches the logger's MDC with both the request method, and the request URI.

If an endpoint accepts path parameters, the `requestUri` MDC variable will only contain the respective placeholder, *not* the parameter values themselves. This keeps values constant, making it easier to filter through logs.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro force-pushed the mdc-request-metadata-enrichment branch from 3f73538 to a62ea8d Compare February 26, 2025 15:05
@nscuro nscuro merged commit 93756a0 into stevespringett:master Feb 26, 2025
2 checks passed
@nscuro nscuro deleted the mdc-request-metadata-enrichment branch February 26, 2025 15:52
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.

1 participant