oldratlee / Log4j2 Ttl Thread Context Map
Licence: apache-2.0
π³ Log4j2 TTL ThreadContextMap, Log4j2 extension integrated TransmittableThreadLocal to MDC
Stars: β 41
Programming Languages
java
68154 projects - #9 most used programming language
Projects that are alternatives of or similar to Log4j2 Ttl Thread Context Map
Timber Ruby
π² Great Ruby logging made easy.
Stars: β 154 (+275.61%)
Mutual labels: context, logging, log
Log4rs
A highly configurable logging framework for Rust
Stars: β 483 (+1078.05%)
Mutual labels: logging, log
Electron Log
Just a simple logging module for your Electron application
Stars: β 765 (+1765.85%)
Mutual labels: logging, log
Daiquiri
Python library to easily setup basic logging functionality
Stars: β 308 (+651.22%)
Mutual labels: logging, log
Dozzle
Realtime log viewer for docker containers.
Stars: β 684 (+1568.29%)
Mutual labels: logging, log
Oklog
A distributed and coΓΆrdination-free log management system
Stars: β 2,937 (+7063.41%)
Mutual labels: logging, log
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: β 33 (-19.51%)
Mutual labels: logging, log
Borgert Cms
Borgert is a CMS Open Source created with Laravel Framework 5.6
Stars: β 298 (+626.83%)
Mutual labels: logging, log
Fliplog
fluent logging with verbose insight, colors, tables, emoji, filtering, spinners, progress bars, timestamps, capturing, stack traces, tracking, presets, & more...
Stars: β 41 (+0%)
Mutual labels: logging, log
gxlog
A concise, functional, flexible and extensible logger for go.
Stars: β 65 (+58.54%)
Mutual labels: log, logging
Logging Helpers
Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.
Stars: β 5 (-87.8%)
Mutual labels: logging, log
π³ Log4j2 TTL ThreadContextMap π³
π§ 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
- Log4j2Demo.java
- Slf4jMdcDemo.java
-
TtlThreadContextMap
implementation class: TtlThreadContextMap.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
- log4j2 documentation
- Mapped Diagnostic Context (MDC) support - slf4j official documentation
- Transmittable ThreadLocal(TTL), π The missing Javaβ’ std lib(simple & 0-dependency) for framework/middleware, provide an enhanced InheritableThreadLocal that transmits ThreadLocal value between threads even using thread pooling components.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].