-
Couldn't load subscription status.
- Fork 38.8k
Description
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