opt:日志优化2

This commit is contained in:
zhangzq
2024-01-05 01:45:43 +08:00
parent ba5c9ad5d1
commit 62023a452e
2 changed files with 1 additions and 2 deletions

View File

@@ -25,7 +25,6 @@ public class AsyncLuceneAppender extends AspectLogbackAsyncAppender {
if (mdcPropertyMap.getClass().getName().contains("SynchronizedMap")) {
mdcPropertyMap.put("traceId", traceId);
}
MDC.clear();
}
super.append(event);
}

View File

@@ -139,8 +139,8 @@ public class LogAspect {
throw ex;
} finally {
log.info("[--response--][请求接口:{} 执行结束][耗时:{}s]", url, (System.currentTimeMillis() - comming) / 1000);
MDC.clear();
LuceneAppender.traceIdTL.remove();
MDC.clear();
}
return result;
}