Awesome Open Source
Awesome Open Source

🌳 Log4j2 TTL ThreadContextMap 🌳

Build Status Coverage Status Maven Central GitHub release GitHub issues License



🔧 Functions

👉 Enable the transmitting Log4j2 ThreadContext(ThreadLocal value) between threads even using thread pooling components by Transmittable ThreadLocal(TTL).

Tested and support all log4j2 version(2.0 ~ 2.14) and java version 6 ~ 13.

👥 Usage

Just add this dependency into your project to activate the Log4j2 TTL ThreadContextMap. ✨

🏃 Run Demo

Run Demo Code

./mvnw clean test-compile -Dexec.classpathScope=test -Dexec.mainClass=com.alibaba.ttl.log4j2.Log4j2Demo exec:java

./mvnw clean test-compile -Dexec.classpathScope=test -Dexec.mainClass=com.alibaba.ttl.log4j2.Slf4jMdcDemo exec:java

🍪 Dependency

<!--
    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>

Find available versions at search.maven.org.

📚 Related resources


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
java (31,121) 
logging (397) 
log (142) 
context (33)