提交 bd528260 编写于 作者: A ascrutae

修复部分问题

上级 cd82c68b
...@@ -10,7 +10,7 @@ import org.apache.logging.log4j.core.pattern.LogEventPatternConverter; ...@@ -10,7 +10,7 @@ import org.apache.logging.log4j.core.pattern.LogEventPatternConverter;
* Created by wusheng on 2016/12/7. * Created by wusheng on 2016/12/7.
*/ */
@Plugin(name = "TraceIdConverter", category = "Converter") @Plugin(name = "TraceIdConverter", category = "Converter")
@ConverterKeys({"tid"}) @ConverterKeys({"traceId"})
public class TraceIdConverter extends LogEventPatternConverter { public class TraceIdConverter extends LogEventPatternConverter {
/** /**
...@@ -24,7 +24,7 @@ public class TraceIdConverter extends LogEventPatternConverter { ...@@ -24,7 +24,7 @@ public class TraceIdConverter extends LogEventPatternConverter {
} }
public static TraceIdConverter newInstance(String[] options) { public static TraceIdConverter newInstance(String[] options) {
return new TraceIdConverter("tid", "tid"); return new TraceIdConverter("traceId", "traceId");
} }
@Override @Override
......
...@@ -5,6 +5,7 @@ import com.a.eye.skywalking.api.Tracing; ...@@ -5,6 +5,7 @@ import com.a.eye.skywalking.api.Tracing;
import com.a.eye.skywalking.network.grpc.TraceId; import com.a.eye.skywalking.network.grpc.TraceId;
import static com.a.eye.skywalking.conf.Constants.CONTEXT_DATA_SEGMENT_SPILT_CHAR; import static com.a.eye.skywalking.conf.Constants.CONTEXT_DATA_SEGMENT_SPILT_CHAR;
import static com.a.eye.skywalking.util.TraceIdUtil.formatTraceId;
public class ContextData { public class ContextData {
private TraceId traceId; private TraceId traceId;
...@@ -76,7 +77,7 @@ public class ContextData { ...@@ -76,7 +77,7 @@ public class ContextData {
public String toString() { public String toString() {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(Tracing.formatTraceId(traceId)); stringBuilder.append(formatTraceId(traceId));
stringBuilder.append(CONTEXT_DATA_SEGMENT_SPILT_CHAR); stringBuilder.append(CONTEXT_DATA_SEGMENT_SPILT_CHAR);
if (parentLevel == null || parentLevel.length() == 0) { if (parentLevel == null || parentLevel.length() == 0) {
stringBuilder.append(" "); stringBuilder.append(" ");
......
...@@ -10,7 +10,7 @@ import com.a.eye.skywalking.plugin.interceptor.enhance.*; ...@@ -10,7 +10,7 @@ import com.a.eye.skywalking.plugin.interceptor.enhance.*;
public class PrintTraceIdInterceptor implements StaticMethodsAroundInterceptor { public class PrintTraceIdInterceptor implements StaticMethodsAroundInterceptor {
@Override @Override
public void beforeMethod(StaticMethodInvokeContext interceptorContext, MethodInterceptResult result) { public void beforeMethod(StaticMethodInvokeContext interceptorContext, MethodInterceptResult result) {
((StringBuilder)interceptorContext.allArguments()[1]).append("TID:" + Tracing.getTraceId()); ((StringBuilder)interceptorContext.allArguments()[0]).append("TID:" + Tracing.getTraceId());
//make sure origin method do not invoke. //make sure origin method do not invoke.
result.defineReturnValue(null); result.defineReturnValue(null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册