How to log request and response bodies in Spring WebFlux

前端 未结 9 1161
一向
一向 2020-11-27 16:41

I want to have centralised logging for requests and responses in my REST API on Spring WebFlux with Kotlin. So far I\'ve tried this approaches

@Bean
fun apiR         


        
9条回答
  •  生来不讨喜
    2020-11-27 17:05

    You can actually enable DEBUG logging for Netty and Reactor-Netty related to see full picture of what's happening. You could play with the below and see what you want and don't. That was the best I could.

    reactor.ipc.netty.channel.ChannelOperationsHandler: DEBUG
    reactor.ipc.netty.http.server.HttpServer: DEBUG
    reactor.ipc.netty.http.client: DEBUG
    io.reactivex.netty.protocol.http.client: DEBUG
    io.netty.handler: DEBUG
    io.netty.handler.proxy.HttpProxyHandler: DEBUG
    io.netty.handler.proxy.ProxyHandler: DEBUG
    org.springframework.web.reactive.function.client: DEBUG
    reactor.ipc.netty.channel: DEBUG
    

提交回复
热议问题