From 434556493efff6acbc4cc7d634e19503f0f17138 Mon Sep 17 00:00:00 2001 From: xiaohanzi Date: Thu, 16 Dec 2021 14:04:52 +0800 Subject: [PATCH] fix haikangweishi --- .../park/impl/haikangweishi/HaiKangWeiShiUtil.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java b/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java index c8de38021..1e47ff205 100644 --- a/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java +++ b/mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java @@ -377,11 +377,14 @@ public class HaiKangWeiShiUtil { } HttpEntity entity = builder.build(); httpPost.setEntity(entity); - + long currentTime = System.currentTimeMillis(); + StringBuffer requestlog = new StringBuffer(); if (null != pairs) { - log.info("haikangweishi httpRequest:[url]"+url+"[params]"+JSON.toJSONString(pairs)); + log.info("haikangweishi httpRequest start :[url]"+url+"[params]"+JSON.toJSONString(pairs)); + requestlog.append("haikangweishi httpRequest:[url]").append(url).append("[params]").append(JSON.toJSONString(pairs)); }else { - log.info("haikangweishi httpRequest:[url]"+url); + log.info("haikangweishi httpRequest start :[url]"+url); + requestlog.append("haikangweishi httpRequest:[url]").append(url); } HttpResponse response = null; try { @@ -389,7 +392,7 @@ public class HaiKangWeiShiUtil { } catch (Exception e) { log.error(e.getLocalizedMessage(),e); } - + long responseCostTime = (System.currentTimeMillis()-currentTime)/1000; String result = null; //打印StatusLine @@ -398,7 +401,8 @@ public class HaiKangWeiShiUtil { //获取实体 HttpEntity httpEntity= response.getEntity(); result = EntityUtils.toString(httpEntity, "UTF-8"); - log.debug(result); + requestlog.append("[response]").append(result).append("[costTime(seconds)]").append(responseCostTime); + log.debug(requestlog.toString()); } catch (Exception e) { log.error(e.getLocalizedMessage(),e); }