Quick question regarding Java Spring Webflux WebClient and the wiretap logging please.
I am currently using Java with SpringBoot Webflux WebClient 2.5.0 to make outbound http requests (where I am the source), I need to make a http request (to a target).
I make the outbound http client like this:
webClientUtil.getWebClient().mutate().baseUrl(someUrl).build().post().body(BodyInserters.fromValue(someRequest)).exchangeToMono(clientResponse -> clientResponse.bodyToMono(SomeResponse.class));
I would like to log the request and the response, hence, I am coding the following:
final HttpClient httpClient = HttpClient.create().wiretap("reactor.netty.http.client.HttpClient", LogLevel.INFO, AdvancedByteBufFormat.HEX_DUMP)
inside a Util class:
public WebClient getWebClient() {
final HttpClient httpClient = HttpClient.create().wiretap("reactor.netty.http.client.HttpClient", LogLevel.INFO, AdvancedByteBufFormat.HEX_DUMP).metrics(true, Function.identity()).proxy(proxy -> proxy.type(ProxyProvider.Proxy.HTTP).host(proxyUrl));
return WebClient.create().mutate().defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE, HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE).clientConnector(new ReactorClientHttpConnector(httpClient)).build();
}
(The WebClient implantation has been tested and working)
And I have my logging level set to INFO with logging.level.root=INFO
Please note the log level is info, the wiretap is also info.
Unfortunately, I am not seeing any extra logs.
What am I doing wrong please?
Thank you!