modify processRequestLog
This commit is contained in:
parent
c4e76ec5ea
commit
8e66c3ea4f
@ -72,9 +72,13 @@ public class RequestLogHandlerInterceptor implements HandlerInterceptor, WebMvcC
|
||||
boolean isJson = JSONUtil.isTypeJSON(body);
|
||||
boolean shortLength = body.length() < 4000;
|
||||
if (shortLength) {
|
||||
try {
|
||||
body = isJson ? JSONUtil.toJsonStr(JSONUtil.isTypeJSONObject(body) ? JSON.parseObject(body) : JSON.parseArray(body)) : body;
|
||||
log.info("[requestUrl:{}][method:{}][param:{}][body:{}]", requestUrl, method,
|
||||
JSON.toJSONString(request.getParameterMap()), body);
|
||||
} catch (Exception exception) {
|
||||
log.warn("json 转化失败[requestUrl:{},body:{}]", requestUrl, body, exception);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
log.warn("request body too long, ignore print");
|
||||
@ -83,6 +87,8 @@ public class RequestLogHandlerInterceptor implements HandlerInterceptor, WebMvcC
|
||||
|
||||
} catch (IOException ioException) {
|
||||
log.warn("打印参数失败[requestUrl:{}]", requestUrl, ioException);
|
||||
} catch (Exception exception) {
|
||||
log.warn("打印参数失败[requestUrl:{}]", requestUrl, exception);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user