diff --git a/agent/http_client_3/src/main/java/com/intuit/tank/httpclient3/TankHttpClient3.java b/agent/http_client_3/src/main/java/com/intuit/tank/httpclient3/TankHttpClient3.java index 0f0ddf8a9..1938c4f6c 100644 --- a/agent/http_client_3/src/main/java/com/intuit/tank/httpclient3/TankHttpClient3.java +++ b/agent/http_client_3/src/main/java/com/intuit/tank/httpclient3/TankHttpClient3.java @@ -252,7 +252,8 @@ private void sendRequest(BaseRequest request, @Nonnull HttpMethod method, String try { uri = method.getURI().toString(); - LOG.debug(request.getLogUtil().getLogMessage("About to " + method.getName() + " request to " + uri + " with requestBody " + requestBody, LogEventType.Informational)); + if (LOG.isDebugEnabled()) LOG.debug(request.getLogUtil().getLogMessage( + "About to " + method.getName() + " request to " + uri + " with requestBody " + requestBody, LogEventType.Informational)); List cookies = new ArrayList(); if (httpclient != null && httpclient.getState() != null && httpclient.getState().getCookies() != null) { cookies = Arrays.stream(httpclient.getState().getCookies()).map(cookie -> "REQUEST COOKIE: " + cookie.toExternalForm() + " (domain=" + cookie.getDomain() + " : path=" + cookie.getPath() + ")").collect(Collectors.toList()); diff --git a/agent/http_client_4/src/main/java/com/intuit/tank/httpclient4/TankHttpClient4.java b/agent/http_client_4/src/main/java/com/intuit/tank/httpclient4/TankHttpClient4.java index 8bfe9c371..788139bf8 100644 --- a/agent/http_client_4/src/main/java/com/intuit/tank/httpclient4/TankHttpClient4.java +++ b/agent/http_client_4/src/main/java/com/intuit/tank/httpclient4/TankHttpClient4.java @@ -276,7 +276,8 @@ public void setProxy(String proxyhost, int proxyport) { private void sendRequest(BaseRequest request, @Nonnull HttpRequestBase method, String requestBody) { long waitTime = 0L; String uri = method.getURI().toString(); - LOG.debug(request.getLogUtil().getLogMessage("About to " + method.getMethod() + " request to " + uri + " with requestBody " + requestBody, LogEventType.Informational)); + if (LOG.isDebugEnabled()) LOG.debug(request.getLogUtil().getLogMessage( + "About to " + method.getMethod() + " request to " + uri + " with requestBody " + requestBody, LogEventType.Informational)); List cookies = new ArrayList(); if (context.getCookieStore().getCookies() != null) { cookies = context.getCookieStore().getCookies().stream().map(cookie -> "REQUEST COOKIE: " + cookie.toString()).collect(Collectors.toList()); diff --git a/agent/http_client_5/src/main/java/com/intuit/tank/httpclient5/TankHttpClient5.java b/agent/http_client_5/src/main/java/com/intuit/tank/httpclient5/TankHttpClient5.java index 627056330..67b44b2bd 100644 --- a/agent/http_client_5/src/main/java/com/intuit/tank/httpclient5/TankHttpClient5.java +++ b/agent/http_client_5/src/main/java/com/intuit/tank/httpclient5/TankHttpClient5.java @@ -273,7 +273,8 @@ public void setProxy(String proxyhost, int proxyport) { } private void sendRequest(BaseRequest request, @Nonnull SimpleHttpRequest method) { - LOG.debug(request.getLogUtil().getLogMessage("About to " + method.getMethod() + " request to " + method.getRequestUri() + " with requestBody " + method.getBody(), LogEventType.Informational)); + if (LOG.isDebugEnabled()) LOG.debug(request.getLogUtil().getLogMessage( + "About to " + method.getMethod() + " request to " + method.getRequestUri() + " with requestBody " + method.getBody(), LogEventType.Informational)); List cookies = new ArrayList(); if (context.getCookieStore().getCookies() != null) { cookies = context.getCookieStore().getCookies().stream()