修复部分问题

This commit is contained in:
ascrutae 2016-12-11 22:41:47 +08:00
parent cd82c68bd4
commit bd528260d9
3 changed files with 5 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import org.apache.logging.log4j.core.pattern.LogEventPatternConverter;
* Created by wusheng on 2016/12/7.
*/
@Plugin(name = "TraceIdConverter", category = "Converter")
@ConverterKeys({"tid"})
@ConverterKeys({"traceId"})
public class TraceIdConverter extends LogEventPatternConverter {
/**
@ -24,7 +24,7 @@ public class TraceIdConverter extends LogEventPatternConverter {
}
public static TraceIdConverter newInstance(String[] options) {
return new TraceIdConverter("tid", "tid");
return new TraceIdConverter("traceId", "traceId");
}
@Override

View File

@ -5,6 +5,7 @@ import com.a.eye.skywalking.api.Tracing;
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.util.TraceIdUtil.formatTraceId;
public class ContextData {
private TraceId traceId;
@ -76,7 +77,7 @@ public class ContextData {
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(Tracing.formatTraceId(traceId));
stringBuilder.append(formatTraceId(traceId));
stringBuilder.append(CONTEXT_DATA_SEGMENT_SPILT_CHAR);
if (parentLevel == null || parentLevel.length() == 0) {
stringBuilder.append(" ");

View File

@ -10,7 +10,7 @@ import com.a.eye.skywalking.plugin.interceptor.enhance.*;
public class PrintTraceIdInterceptor implements StaticMethodsAroundInterceptor {
@Override
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.
result.defineReturnValue(null);