DBZ-5180 Put the MysqlPartition values to MDC getting NPE in logging context phase
This commit is contained in:
parent
7ac91c4450
commit
9a3afac243
@ -99,8 +99,12 @@ public static PreviousContext forConnector(String connectorType, String connecto
|
||||
if (taskId != null) {
|
||||
MDC.put(TASK_ID, taskId);
|
||||
}
|
||||
if (partition != null) {
|
||||
partition.getLoggingContext().forEach(MDC::put);
|
||||
if (partition != null && partition.getLoggingContext() != null) {
|
||||
partition.getLoggingContext().forEach((k, v) -> {
|
||||
if (k != null && v != null) {
|
||||
MDC.put(k, v);
|
||||
}
|
||||
});
|
||||
}
|
||||
MDC.put(CONNECTOR_TYPE, connectorType);
|
||||
MDC.put(CONNECTOR_NAME, connectorName);
|
||||
|
Loading…
Reference in New Issue
Block a user