opt:日志优化2
This commit is contained in:
@@ -25,7 +25,6 @@ public class AsyncLuceneAppender extends AspectLogbackAsyncAppender {
|
|||||||
if (mdcPropertyMap.getClass().getName().contains("SynchronizedMap")) {
|
if (mdcPropertyMap.getClass().getName().contains("SynchronizedMap")) {
|
||||||
mdcPropertyMap.put("traceId", traceId);
|
mdcPropertyMap.put("traceId", traceId);
|
||||||
}
|
}
|
||||||
MDC.clear();
|
|
||||||
}
|
}
|
||||||
super.append(event);
|
super.append(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ public class LogAspect {
|
|||||||
throw ex;
|
throw ex;
|
||||||
} finally {
|
} finally {
|
||||||
log.info("[--response--][请求接口:{} 执行结束][耗时:{}s]", url, (System.currentTimeMillis() - comming) / 1000);
|
log.info("[--response--][请求接口:{} 执行结束][耗时:{}s]", url, (System.currentTimeMillis() - comming) / 1000);
|
||||||
MDC.clear();
|
|
||||||
LuceneAppender.traceIdTL.remove();
|
LuceneAppender.traceIdTL.remove();
|
||||||
|
MDC.clear();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user