I believe it is a standard to log request and response in order to track down any issues reported by users and also to integrate it with tools like Splunk.
I've found 2 approaches so far, but none of them is really solving this issue properly:
- https://mcmap.net/q/319511/-how-to-log-request-and-response-bodies-in-spring-webflux
- https://mcmap.net/q/319511/-how-to-log-request-and-response-bodies-in-spring-webflux
Someone even wrote it is against reactive stack: https://mcmap.net/q/319511/-how-to-log-request-and-response-bodies-in-spring-webflux
So I have questions:
- Isn't there any recommended way of doing it by Spring team?
- If logging in webflux is against reactive stack then how should we actually log request/response?
- If Webflux is not a proper place to log request/response then where should we catch those information from? Nginx could possibly log it with a request id - but is it a proper way of solving this issue?
LoggingHandler
directly intoHttpClient
; would be delighted to hear other opinions though :) – Mobility