wuxingye commented on a change in pull request #3365: add logstash logback plugin URL: https://github.com/apache/skywalking/pull/3365#discussion_r319067177
########## File path: docs/en/setup/service-agent/java-agent/Application-toolkit-logback-1.x.md ########## @@ -55,3 +56,25 @@ ``` * When you use `-javaagent` to active the sky-walking tracer, logback will output **traceId**, if it existed. If the tracer is inactive, the output will be `TID: N/A`. + +# logstash logback plugin + +* Dependency the toolkit, such as using maven or gradle + +```xml +<dependency> + <groupId>org.apache.skywalking</groupId> + <artifactId>apm-toolkit-logback-1.x</artifactId> + <version>${skywalking.version}</version> +</dependency> +``` + +* set `LogstashEncoder` of logback.xml + +```xml +<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"> + <provider class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.logstash.TraceIdJsonProvider"> + </provider> + <customFields>{"app_id":"${app_id}"}</customFields> Review comment: it is a field that can be used by logstash to create es index ```json input { tcp { port => 4560 codec => json } } output { elasticsearch { action => "index" hosts =>["es01:9200", "es02:9200", "es03:9200"] index => "app-%{[app_id]}-%{+YYYY.MM.dd}" } } ``` I've removed it ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services