|
@@ -33,9 +33,7 @@ import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
|
*/
|
|
|
public class HttpClientUtil {
|
|
|
|
|
|
- private static final ExamCloudLog LOGGER = ExamCloudLogFactory.getLog("HTTP_CLIENT");
|
|
|
-
|
|
|
- protected static ExamCloudLog log = ExamCloudLogFactory.getLog("HTTP_CLIENT");
|
|
|
+ private static final ExamCloudLog LOGGER = ExamCloudLogFactory.getLog("HTTP_CLIENT_LOGGER");
|
|
|
|
|
|
private static CloseableHttpClient httpclient;
|
|
|
|
|
@@ -94,20 +92,20 @@ public class HttpClientUtil {
|
|
|
responseHolder = new JsonHttpResponseHolder(statusCode, obj);
|
|
|
|
|
|
if (HttpStatus.SC_OK != responseHolder.getStatusCode()) {
|
|
|
- log.error("[HTTP-FAIL]. statusCode=" + statusCode + "; responseEntity=" + entityStr
|
|
|
- + "; uri=" + request.getURI());
|
|
|
+ LOGGER.error("[HTTP-FAIL]. statusCode=" + statusCode + "; responseEntity="
|
|
|
+ + entityStr + "; uri=" + request.getURI());
|
|
|
} else {
|
|
|
- if (log.isDebugEnabled()) {
|
|
|
- log.debug("[HTTP-OK]. statusCode=" + statusCode + "; responseEntity="
|
|
|
+ if (LOGGER.isDebugEnabled()) {
|
|
|
+ LOGGER.debug("[HTTP-OK]. statusCode=" + statusCode + "; responseEntity="
|
|
|
+ entityStr + "; uri=" + request.getURI());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
- log.error("[HTTP-ERROR]. uri=" + request.getURI(), e);
|
|
|
+ LOGGER.error("[HTTP-ERROR]. uri=" + request.getURI(), e);
|
|
|
} finally {
|
|
|
IOUtils.closeQuietly(response);
|
|
|
- log.debug("[HTTP-COST]. cost = " + (System.currentTimeMillis() - s) + " ms; uri="
|
|
|
+ LOGGER.debug("[HTTP-COST]. cost = " + (System.currentTimeMillis() - s) + " ms; uri="
|
|
|
+ request.getURI());
|
|
|
}
|
|
|
return responseHolder;
|