Browse Source

增加日志输出

15810770710@163.com 3 years ago
parent
commit
5c18581802

+ 8 - 5
src/main/java/com/jkcredit/illegal/info/service/impl/IllegalInfoServiceImpl.java

@@ -44,7 +44,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
         String result = OkHttpUtil.doPost(illegalInfoUrl, body, CommonConstant.PERSON_TIME_OUT);
         log.info("调用上游接口-流水号:{}, 入参:{}, 返回:{}, 时延:{}", requestParams.getTraceId(), body, result, System.currentTimeMillis() - startTime);
         if (StringUtils.isBlank(result)) {
-            log.info("调用上游接口-流水号:{}, 入参:{}, 请求上游失败无返回", requestParams.getTraceId(), body);
+            log.info("checkIllegalInfoRequestError-流水号:{}, 入参:{}, 请求上游失败无返回", requestParams.getTraceId(), body);
             stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_TIME_OUT).increment();
         }
 
@@ -58,7 +58,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
                 illegalInfoResult = JSON.toJavaObject(JSON.parseObject(result), IllegalInfoResult.class);
             }
         } catch (Exception e) {
-            log.error("调用上游接口-流水号:{}, 入参:{}, 解析上游返回异常:{}", requestParams.getTraceId(), body, e);
+            log.error("checkIllegalInfo解析异常-流水号:{}, 入参:{}, 解析上游返回异常:{}", requestParams.getTraceId(), body, e);
             illegalInfoResult = new IllegalInfoResult().normalResult();
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, false, requestParams.getTraceId())));
             return illegalInfoResult;
@@ -72,6 +72,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
             // 查询错误,不计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, false, requestParams.getTraceId())));
             stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_QUERY_FAILED).increment();
+            log.info("checkIllegalInfoResultError-流水号:{}, 上游结果异常", requestParams.getTraceId());
         } else {
             // 查询成功,计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, true, requestParams.getTraceId())));
@@ -94,7 +95,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
         String result = OkHttpUtil.doPost(vehicleIllegalInfoUrl, body, CommonConstant.VEHICLE_TIME_OUT);
         log.info("调用上游接口-流水号:{}, 入参:{}, 返回:{}, 时延:{}", requestParam.getTraceId(), body, result, System.currentTimeMillis() - startTime);
         if (StringUtils.isBlank(result)) {
-            log.info("调用上游接口-流水号:{}, 入参:{}, 请求上游失败无返回", requestParam.getTraceId(), body);
+            log.info("checkVehicleIllegalInfoRequestError-流水号:{}, 入参:{}, 请求上游失败无返回", requestParam.getTraceId(), body);
             stringRedisTemplate.boundValueOps(CommonConstant.VEHICLE_ILLEGAL_INFO_TIME_OUT).increment();
             return null;
         }
@@ -105,6 +106,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
             // 查询错误,不计费
             CHARGE_LOGGER.info(JSON.toJSONString(new VehicleIllegalInfoChargeObject(vehicleIllegalInfoResult, false, requestParam.getTraceId())));
             stringRedisTemplate.boundValueOps(CommonConstant.VEHICLE_ILLEGAL_INFO_QUERY_FAILED).increment();
+            log.info("checkVehicleIllegalInfoResultError-流水号:{}, 上游结果异常", requestParam.getTraceId());
         } else {
             // 查询成功,计费
             CHARGE_LOGGER.info(JSON.toJSONString(new VehicleIllegalInfoChargeObject(vehicleIllegalInfoResult, true, requestParam.getTraceId())));
@@ -138,7 +140,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
         String result = OkHttpUtil.doPost(illegalInfoUrl, body, CommonConstant.PERSON_TIME_OUT);
         log.info("调用上游接口-流水号:{}, 入参:{}, 返回:{}, 时延:{}", requestParams.getTraceId(), body, result, System.currentTimeMillis() - startTime);
         if (StringUtils.isBlank(result)) {
-            log.info("调用上游接口-流水号:{}, 入参:{}, 请求上游失败无返回", requestParams.getTraceId(), body);
+            log.info("checkIllegalInfoRequestError-流水号:{}, 入参:{}, 请求上游失败无返回", requestParams.getTraceId(), body);
             stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_TIME_OUT).increment();
         }
 
@@ -152,7 +154,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
                 illegalInfoResult = JSON.toJavaObject(JSON.parseObject(result), IllegalInfoResult.class);
             }
         } catch (Exception e) {
-            log.error("调用上游接口-流水号:{}, 入参:{}, 解析上游返回异常:{}", requestParams.getTraceId(), body, e);
+            log.error("checkIllegalInfo解析异常-流水号:{}, 入参:{}, 解析上游返回异常:{}", requestParams.getTraceId(), body, e);
             illegalInfoResult = new IllegalInfoResult().normalResult();
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, false, requestParams.getTraceId())));
             return illegalInfoResult;
@@ -166,6 +168,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
             // 查询错误,不计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, false, requestParams.getTraceId())));
             stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_QUERY_FAILED).increment();
+            log.info("checkIllegalInfoResultError-流水号:{}, 上游结果异常", requestParams.getTraceId());
         } else {
             // 查询成功,计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, true, requestParams.getTraceId())));