* Dependency the toolkit, such as using maven or gradle
```xml
org.apache.skywalking
apm-toolkit-log4j-2.x
{project.release.version}
```
[  ](https://bintray.com/wu-sheng/skywalking/org.apache.skywalking.apm-toolkit-log4j-2.x/_latestVersion)
* Config the `[%traceId]` pattern in your log4j2.xml
```xml
```
* When you use `-javaagent` to active the sky-waking tracer, log4j2 will output **traceId**, if it existed. If the tracer is inactive, the output will be `TID: N/A`.