Browse Source

统一日志格式

master
Binary Wang 7 years ago
parent
commit
0f0f7bb0a3
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/AbstractWxMpServiceImpl.java

+ 3
- 3
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/AbstractWxMpServiceImpl.java View File

@@ -286,7 +286,7 @@ public abstract class AbstractWxMpServiceImpl<H, P> implements WxMpService, Requ


try { try {
T result = executor.execute(uriWithAccessToken, data); T result = executor.execute(uriWithAccessToken, data);
this.log.debug("\n[URL]: {}\n[PARAMS]: {}\n[RESPONSE]: {}", uriWithAccessToken, data, result);
this.log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uriWithAccessToken, data, result);
return result; return result;
} catch (WxErrorException e) { } catch (WxErrorException e) {
WxError error = e.getError(); WxError error = e.getError();
@@ -305,12 +305,12 @@ public abstract class AbstractWxMpServiceImpl<H, P> implements WxMpService, Requ
} }


if (error.getErrorCode() != 0) { if (error.getErrorCode() != 0) {
this.log.error("\n[URL]: {}\n[PARAMS]: {}\n[RESPONSE]: {}", uriWithAccessToken, data, error);
this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, data, error);
throw new WxErrorException(error); throw new WxErrorException(error);
} }
return null; return null;
} catch (IOException e) { } catch (IOException e) {
this.log.error("\n[URL]: {}\n[PARAMS]: {}\n[EXCEPTION]: {}", uriWithAccessToken, data, e.getMessage());
this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, data, e.getMessage());
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }


Loading…
Cancel
Save