Commit eb873c31 authored by 于桐's avatar 于桐

日志优化,超长返回结果截取

parent 58a3be11
......@@ -56,7 +56,8 @@ public class LogCallHttpAspect {
} finally {
Stopwatch stop = stopwatch.stop();
long elapsed = stop.elapsed(TimeUnit.MILLISECONDS);
String resultStr = result == null ? "" : objectMapper.writeValueAsString(result).substring(0, 500);
String resultStr = result == null ? "" : objectMapper.writeValueAsString(result);
resultStr = resultStr.length() < 500 ? resultStr : resultStr.substring(0, 500);
log.info("[httpRequestLog],url:[{}],remoteIP:[{}],args:[{}],duration:[{}],exception:[{}],result:[{}]",
request.getRequestURL(), remoteIP, args, elapsed, hasException, resultStr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment