In Vertx webclient how to log http request and response

Viewed 2817

What is the simplest way for logging outgoing http request and response in Vertx WebClient. I'm looking for something similar to the httpserver LoggerHandler, but then for the webclient thus outgoing requests.

1 Answers

WebClient has an overloaded create(Vertx, WebClientOptions) method.

WebClientOptions has a setLogActivity() method that accepts a boolean parameter that indicates if network activity should be logged.

(disclaimer: i haven't tried this myself so i can't vouch for what's actually logged, but see if that covers your needs).

Related