|
|
@@ -32,7 +32,6 @@ public class CatchLogAspect {
|
|
|
|
|
|
@Around("pointcut()")
|
|
|
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
|
|
|
-// String traceId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
|
// 1. 获取 HttpServletRequest
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
@@ -91,10 +90,10 @@ public class CatchLogAspect {
|
|
|
}
|
|
|
|
|
|
if (!paramMap.isEmpty()) {
|
|
|
- log.info("[traceId:{}] REQUEST PARAMS: {}", traceId, JSON.toJSONString(paramMap));
|
|
|
+ log.info("REQUEST PARAMS: {}", JSON.toJSONString(paramMap));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.error("[traceId:{}] 请求日志记录失败: {}", traceId, e.getMessage(), e);
|
|
|
+ log.error("请求日志记录失败: {}", e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -104,10 +103,10 @@ public class CatchLogAspect {
|
|
|
private void logResponse(Object response, String traceId) {
|
|
|
try {
|
|
|
if (response != null) {
|
|
|
- log.info("[traceId:{}] RESPONSE: {}", traceId, JSON.toJSONString(response));
|
|
|
+ log.info("RESPONSE: {}", JSON.toJSONString(response));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.error("[traceId:{}] 响应日志记录失败: {}", traceId, e.getMessage(), e);
|
|
|
+ log.error("响应日志记录失败: {}", e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
}
|