ttl
log4j2-PatternLayout
实现
jvm添加启动参数:
-javaagent:path/to/transmittable-thread-local-2.x.y.jar
引用maven:
<!--
because this dependency is implemented by log4j2 runtime extension
that will never be used by biz code,
set scope to *runtime*.
-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>log4j2-ttl-thread-context-map</artifactId>
<version>1.3.3</version>
<scope>runtime</scope>
</dependency>
log4j2 xml配置:[%X{traceId}]
log4j2 新增properties配置文件log4j2.component.properties,内容:
log4j2.threadContextMap=com.alibaba.ttl.log4j2.TtlThreadContextMap
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。