We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
由于项目采取大量的异步线程池执行,所以说一个流程的日志散落到了多行,线上出现异常的时候不好定位问题,建议给每个流程添加一个追踪id,用于在出现异常时能很快把相关日志全部查出,暂时看到了三个切入点: 1.http请求可添加一个全局的/**的拦截器 MDC.put("TansId", TransIdUtils.generateDateTimeInnerTransId()); 2.异步线程池mdc跟踪,KeyCallable中添加变量mdc上下文内容 private final Map<String, String> logContextMap; logContextMap = MDC.getCopyOfContextMap(); if (this.logContextMap != null) { MDC.setContextMap(this.logContextMap); } 3.quartz定时任务,CacheBaseJob的excute函数中添加追踪id MDC.put("TansId", TransIdUtils.generateDateTimeInnerTransId()); 4.应用日志异步打印,实时刷盘会局限于磁盘io性能 5.日志格式、存放路径之类的可配置化
MDC.put("TansId", TransIdUtils.generateDateTimeInnerTransId());
private final Map<String, String> logContextMap;
logContextMap = MDC.getCopyOfContextMap();
if (this.logContextMap != null) { MDC.setContextMap(this.logContextMap); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
由于项目采取大量的异步线程池执行,所以说一个流程的日志散落到了多行,线上出现异常的时候不好定位问题,建议给每个流程添加一个追踪id,用于在出现异常时能很快把相关日志全部查出,暂时看到了三个切入点:
1.http请求可添加一个全局的/**的拦截器
MDC.put("TansId", TransIdUtils.generateDateTimeInnerTransId());
2.异步线程池mdc跟踪,KeyCallable中添加变量mdc上下文内容
private final Map<String, String> logContextMap;
logContextMap = MDC.getCopyOfContextMap();
if (this.logContextMap != null) { MDC.setContextMap(this.logContextMap); }
3.quartz定时任务,CacheBaseJob的excute函数中添加追踪id
MDC.put("TansId", TransIdUtils.generateDateTimeInnerTransId());
4.应用日志异步打印,实时刷盘会局限于磁盘io性能
5.日志格式、存放路径之类的可配置化
The text was updated successfully, but these errors were encountered: