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 2019/12/06 09:19:59 UTC
[GitHub] [skywalking] gonedays edited a comment on issue #4016: How to
integrate with logstash-logback-encoder in json format
gonedays edited a comment on issue #4016: How to integrate with logstash-logback-encoder in json format
URL: https://github.com/apache/skywalking/issues/4016#issuecomment-562496351
Get solution for this, just add the Converter in logback.xml:
```
<configuration>
<conversionRule conversionWord="tid" converterClass="org.apache.skywalking.apm.toolkit.log.logback.v1.x.LogbackPatternConverter"/>
<!--appender-->
<appender name="logstash" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH:-.}/${APP_NAME}/${APP_NAME}_json.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH:-.}/${APP_NAME}/${APP_NAME}_json.log.%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<timestamp>
<timeZone>UTC</timeZone>
</timestamp>
<pattern>
<pattern>
{
"level": "%level",
"ip": "${IP}",
"service": "${APP_NAME:-}",
"tid": "%tid",
"pid": "${PID:-}",
"thread": "%thread",
"class": "%logger{1.}:%L",
"message": "%message",
"stackTrace": "%exception{10}"
}
</pattern>
</pattern>
</providers>
</encoder>
</appender>
</configuration>
```
Thanks anyway.
----------------------------------------------------------------
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
With regards,
Apache Git Services