Logging

Use the {@link oajrc.RestClientBuilder#logTo(Level,Logger)} and {@link oajrc.RestCall#logTo(Level,Logger)} methods to log HTTP calls. These methods will cause the HTTP request and response headers and body to be logged to the specified logger.

Example:

// Log the HTTP request/response to the specified logger. int rc = restClient.doGet(URL).logTo(INFO, getLogger()).run();

The method call is ignored if the logger level is below the specified level.

Customized logging can be handled by sub-classing the {@link oajrc.RestCallLogger} class and using the {@link oajrc.RestCall#interceptor(RestCallInterceptor)} method.