httprequestquarkusquarkus-rest-client

Logging HTTP requests and responses in quarkus resteasy


I am running into a problem with calling a REST endpoint on a server, using a REST client in Quarkus, built with the org.eclipse.microprofile.rest.client.RestClientBuilder. I would very much like to debug the service, by writing the HTTP requests and responses to the log, so I might see what is actually being sent to the server. The hunt for a guide for that particular issue has eluded me however. I managed to build a logging filter but that only logs out the URL and the Entitys toString value, which is not at all the same as the HTTP request and response being sent. Help me by pointing me to a solution to log the actual HTTP request and response.


Solution

  • If you are using resteasy reactive you can turn on logging with:

    quarkus.rest-client.logging.scope=request-response
    quarkus.rest-client.logging.body-limit=1024
    quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=DEBUG