Added conditional InvokeHTTP HTTP debug log
Wrapping if statements prevent them from being called at all if debug logging is disabled
This closes
@@ -1299,14 +1299,18 @@ public class InvokeHTTP extends AbstractProcessor {
}
private void logRequest(ComponentLog logger, Request request) {
+ if (logger.isDebugEnabled()) {
logger.debug("\nRequest to remote service:\n\t{}\n{}",
request.url().url().toExternalForm(), getLogString(request.headers().toMultimap()));
}
+ }
private void logResponse(ComponentLog logger, URL url, Response response) {
+ if (logger.isDebugEnabled()) {
logger.debug("\nResponse from remote service:\n\t{}\n{}",
url.toExternalForm(), getLogString(response.headers().toMultimap()));
}
+ }
private String getLogString(Map<String, List<String>> map) {
StringBuilder sb = new StringBuilder();
