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

Add correlation id to log messages in WebFlux [SPR-16966] #21504

Closed
spring-projects-issues opened this issue Jun 21, 2018 · 1 comment
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 21, 2018

Rossen Stoyanchev opened SPR-16966 and commented

In order to improve logging for WebFlux requests, as part of #21437, e.g. to avoid duplicate information (e.g. request path) being logged multiple times, log messages for a given request need to insert a common log id, so that the messages can be correlated regardless of the thread id.

This can be done be exposing a well-known request attribute via ServerWebExchange and a convenience method on ServerWebExchange to access it.


Affects: 5.0.7

This issue is a sub-task of #21485

Issue Links:

Referenced from: commits bc3cf0e, 39d5874, 5dc49b1, fd90b73, 8231066, 5cdc267

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Similar ticket in Reactor Netty that we might want to play well with:
reactor/reactor-netty#33

Perhaps what makes more sense then is to have ServerHttpRequest#getRequestId() or just getId() which would come from the underlying channel or connection if possible (Reactor Netty, Undertow) but otherwise, if that's not available, could be something like the identity hashcode of the ServletHttpRequest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants