|
@@ -1,6 +1,7 @@
|
|
|
package com.mrxu.framework.boot.entity;
|
|
package com.mrxu.framework.boot.entity;
|
|
|
|
|
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
|
|
+import org.slf4j.MDC;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
@@ -20,6 +21,7 @@ public class RpcRequestInfo implements Serializable {
|
|
|
|
|
|
|
|
public static void remove() {
|
|
public static void remove() {
|
|
|
rpcRequestInfo.remove();
|
|
rpcRequestInfo.remove();
|
|
|
|
|
+ MDC.clear();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected String trackId;
|
|
protected String trackId;
|
|
@@ -52,4 +54,13 @@ public class RpcRequestInfo implements Serializable {
|
|
|
return get().fromServiceName;
|
|
return get().fromServiceName;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void setTrackId(String trackId) {
|
|
|
|
|
+ get().trackId = trackId;
|
|
|
|
|
+ MDC.put("trackId",trackId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setIp(String ip) {
|
|
|
|
|
+ get().ip = ip;
|
|
|
|
|
+ MDC.put("ip",ip);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|