update - REQ-2324-修复日志输出报错问题

This commit is contained in:
yangqicheng 2024-05-30 18:14:31 +08:00
parent 7a3efea30d
commit 64c8708d9d

View File

@ -67,19 +67,7 @@ public class ErrorReportAspect implements Ordered {
watch.start(signature.toShortString());
Object result = joinPoint.proceed();
watch.stop();
String params = "";
String resultStr = "";
Object[] args = joinPoint.getArgs();
if (args != null && args.length > 0) {
try {
params = Arrays.stream(args).map(JSONUtil::toJsonStr).collect(Collectors.joining(","));
resultStr = JSONUtil.toJsonStr(result);
} catch (Exception e) {
params = "参数转换JSON字符串异常:" + e.getMessage();
resultStr = "参数转换JSON字符串异常:" + e.getMessage();
}
}
log.info("StopWatch '{}',params:{},result:{}: running time = {} 's", watch.getLastTaskName(), watch.getTotalTimeSeconds(), params, resultStr);
log.info("StopWatch '{}': running time = {} 's", watch.getLastTaskName(), watch.getTotalTimeSeconds());
if (!signature.toShortString().contains("ExtAxApiLogServiceImpl")) {
String type = getType(joinPoint);