mirror of
https://github.com/apache/skywalking.git
synced 2026-11-06 10:07:51 +00:00
5
sky walking application toolkit log4j 2.x
吴晟 Wu Sheng edited this page 2017-07-10 14:27:08 +08:00
- Dependency the toolkit, such as using maven or gradle
<dependency>
<groupId>org.skywalking</groupId>
<artifactId>apm-toolkit-log4j-2.x</artifactId>
<version>{project.release.version}</version>
</dependency>
- Config the
[%traceId]pattern in your log4j2.xml
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d [%traceId] %-5p %c{1}:%L - %m%n"/>
</Console>
</Appenders>
- When you use
-javaagentto active the sky-waking tracer, log4j2 will output traceId, if it existed. If the tracer is inactive, the output will beTID: N/A.