fix processRequestLog

This commit is contained in:
jinhaiyang 2024-04-12 15:51:22 +08:00
parent 27e272f18e
commit 99b03a3b9b

View File

@ -72,7 +72,7 @@ public class RequestLogHandlerInterceptor implements HandlerInterceptor, WebMvcC
boolean isJson = JSONUtil.isTypeJSON(body); boolean isJson = JSONUtil.isTypeJSON(body);
boolean shortLength = body.length() < 4000; boolean shortLength = body.length() < 4000;
if (shortLength) { if (shortLength) {
body = isJson ? JSONUtil.toJsonStr(JSON.parseObject(body)) : body; body = isJson ? JSONUtil.toJsonStr( JSONUtil.isTypeJSONObject(body) ? JSON.parseObject(body) : JSON.parseArray(body)) : body;
log.info("[requestUrl:{}][method:{}][param:{}][body:{}]", requestUrl, method, log.info("[requestUrl:{}][method:{}][param:{}][body:{}]", requestUrl, method,
JSON.toJSONString(request.getParameterMap()), body); JSON.toJSONString(request.getParameterMap()), body);
return; return;