update 优化 将Log记录参数长度扩充为5000更符合实际需求

This commit is contained in:
疯狂的狮子Li
2024-11-14 16:21:56 +08:00
parent a18e430056
commit 41240fc415
5 changed files with 12 additions and 12 deletions

View File

@ -100,7 +100,7 @@ public class LogAspect {
if (e != null) {
operLog.setStatus(BusinessStatus.FAIL.ordinal());
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 5000));
}
// 设置方法名称
String className = joinPoint.getTarget().getClass().getName();
@ -146,7 +146,7 @@ public class LogAspect {
}
// 是否需要保存response参数和值
if (log.isSaveResponseData() && ObjectUtil.isNotNull(jsonResult)) {
operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 2000));
operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 5000));
}
}
@ -161,11 +161,11 @@ public class LogAspect {
String requestMethod = operLog.getRequestMethod();
if (MapUtil.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name())) {
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
operLog.setOperParam(StringUtils.substring(params, 0, 5000));
} else {
MapUtil.removeAny(paramsMap, EXCLUDE_PROPERTIES);
MapUtil.removeAny(paramsMap, excludeParamNames);
operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 2000));
operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 5000));
}
}