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

Single category for all WebFlux logging [SPR-17012] #21550

Closed
spring-issuemaster opened this issue Jul 5, 2018 · 2 comments
Closed

Single category for all WebFlux logging [SPR-17012] #21550

spring-issuemaster opened this issue Jul 5, 2018 · 2 comments
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jul 5, 2018

Rossen Stoyanchev opened SPR-17012 and commented

The following must be on for WebFlux DEBUG logging:

  • "org.springframework.core.codec"
  • "org.springframework.http.codec"
  • "org.springframework.web"

When "org.springframework.web" is on, intuitively the expectation is to see all web-related logging, but in WebFlux where codecs add essential logging, it's easy to overlook this or know to enable those extra log categories. Even if you do know, it's rather cumbersome to work with 3 categories where logically it's one thing you want (client or server web logging).

The idea is that each HttpMessageReader or HttpMessageWriter would fall back on a shared secondary logger with a category such as "org.springframework.web..http.codecs", or something similar, as long as it starts with "org.springframework.web".

Such a shared logger could be passed as a hint to Encoder and Decoder implementations in spring-core, which is something we already do for a shared log prefix and for suppressing logging sensitive information.

This should give the desired effect of a single root category for web logging. It also provides control, so if you enable all 3 of the above you get normal, class name based logging. Or vice versa it's possible to suppress the fallback category explicitly. We could even detect this at startup and log a message under that shared logger which explains why it's on.


Affects: 5.0.7

This issue is a sub-task of #21485

Referenced from: commits 31bfc1d, 4d6f2df, fac2e35, 4bd22ee, 833aee9

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jul 6, 2018

Arjen Poutsma commented

Sounds like a good idea for me!

I would not bother with the dot dot syntax, though, I would just use the category "org.springframework.web.codec" for all logging coming from both core.codec as well as http.codec.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jul 6, 2018

Rossen Stoyanchev commented

Okay, "org.springframework.web.codec" is cleaner and clear enough it's not a typical category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.