mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
增加日志配置 fix #1570
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.Properties;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
@@ -27,7 +28,7 @@ public class LoggerAdapterExample implements OuterAdapter {
|
||||
|
||||
@Override
|
||||
public void init(OuterAdapterConfig configuration, Properties envProperties) {
|
||||
|
||||
MDC.put("adapter", "logger");
|
||||
}
|
||||
|
||||
public void sync(List<Dml> dmls) {
|
||||
@@ -42,6 +43,6 @@ public class LoggerAdapterExample implements OuterAdapter {
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
MDC.remove("adapter");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user