You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/01/28 14:25:54 UTC
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #6275: Remove state / isError and collect exception stacktrace in error logs
kezhenxu94 commented on a change in pull request #6275:
URL: https://github.com/apache/skywalking/pull/6275#discussion_r566133805
##########
File path: apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-1.x-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/log/log4j/v1/x/log/GRPCLogAppenderInterceptor.java
##########
@@ -92,12 +93,16 @@ private LogData transform(LoggingEvent event) {
.setKey("thread").setValue(event.getThreadName()).build())
.build())
.setBody(LogDataBody.newBuilder().setType(LogDataBody.ContentCase.TEXT.name())
- .setText(TextLog.newBuilder().setText(event.getMessage()).build()).build());
+ .setText(TextLog.newBuilder().setText(transformLogText(event)).build()).build());
return -1 == ContextManager.getSpanId() ? builder.build()
: builder.setTraceContext(TraceContext.newBuilder()
.setTraceId(ContextManager.getGlobalTraceId())
.setSpanId(ContextManager.getSpanId())
.setTraceSegmentId(ContextManager.getSegmentId())
.build()).build();
}
+
+ private String transformLogText(final LoggingEvent event) {
+ return event.getMessage() + "\n" + ThrowableTransformer.INSTANCE.convert2String(event.getThrowable(), 2048);
Review comment:
I'm wondering whether this `2048` deserves a new config item, or the default value is suitable in this case @wu-sheng .
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org