优化日志
This commit is contained in:
parent
60692f5ff6
commit
36f56b40dd
@ -27,10 +27,6 @@ public class LogMdcConfiguration {
|
||||
@PostConstruct
|
||||
public void contextOperatorHook() {
|
||||
Hooks.onEachOperator(PRINT_LOG_ID, Operators.lift((r, c) ->{
|
||||
/*Context ctx = c.currentContext();
|
||||
if(ctx.hasKey(PRINT_LOG_ID)){
|
||||
MDC.put(PRINT_LOG_ID, ctx.get(PRINT_LOG_ID));
|
||||
}*/
|
||||
return new MdcContextSubscriber(c);
|
||||
}));
|
||||
}
|
||||
@ -69,9 +65,8 @@ public class LogMdcConfiguration {
|
||||
|
||||
@Override
|
||||
public void onNext(T t) {
|
||||
Context ctx = currentContext();
|
||||
if(ctx.hasKey(PRINT_LOG_ID)){
|
||||
MDC.put(PRINT_LOG_ID, ctx.get(PRINT_LOG_ID));
|
||||
if(currentContext().hasKey(PRINT_LOG_ID)){
|
||||
MDC.put(PRINT_LOG_ID, currentContext().get(PRINT_LOG_ID));
|
||||
}
|
||||
coreSubscriber.onNext(t);
|
||||
}
|
||||
|
||||
@ -26,10 +26,6 @@ public class LogMdcConfiguration {
|
||||
@PostConstruct
|
||||
public void contextOperatorHook() {
|
||||
Hooks.onEachOperator(PRINT_LOG_ID, Operators.lift((r, c) ->{
|
||||
Context ctx = c.currentContext();
|
||||
if(ctx.hasKey(PRINT_LOG_ID)){
|
||||
MDC.put(PRINT_LOG_ID, ctx.get(PRINT_LOG_ID));
|
||||
}
|
||||
return new MdcContextSubscriber(c);
|
||||
}));
|
||||
}
|
||||
@ -69,7 +65,9 @@ public class LogMdcConfiguration {
|
||||
|
||||
@Override
|
||||
public void onNext(T t) {
|
||||
|
||||
if(coreSubscriber.currentContext().hasKey(PRINT_LOG_ID)){
|
||||
MDC.put(PRINT_LOG_ID, coreSubscriber.currentContext().get(PRINT_LOG_ID));
|
||||
}
|
||||
coreSubscriber.onNext(t);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user