{"id":16686165,"url":"https://github.com/oldratlee/log4j2-ttl-thread-context-map","last_synced_at":"2026-01-11T17:44:22.587Z","repository":{"id":34880679,"uuid":"38895775","full_name":"oldratlee/log4j2-ttl-thread-context-map","owner":"oldratlee","description":"🌳 Log4j2 TTL ThreadContextMap, Log4j2 extension integrated TransmittableThreadLocal to MDC","archived":false,"fork":false,"pushed_at":"2025-03-03T03:54:28.000Z","size":232,"stargazers_count":91,"open_issues_count":4,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T11:06:36.974Z","etag":null,"topics":["context","log","log4j","log4j2","logging","logging-facilities","mapped-diagnostic-context","mdc","thread-context-map","transmittable-thread-local"],"latest_commit_sha":null,"homepage":"https://github.com/oldratlee/log4j2-ttl-thread-context-map","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oldratlee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-10T18:27:06.000Z","updated_at":"2025-03-03T03:54:26.000Z","dependencies_parsed_at":"2023-02-18T05:31:26.258Z","dependency_job_id":"f325f9ad-918d-4470-ac83-9a8081fc4b84","html_url":"https://github.com/oldratlee/log4j2-ttl-thread-context-map","commit_stats":{"total_commits":114,"total_committers":2,"mean_commits":57.0,"dds":"0.33333333333333337","last_synced_commit":"9e5e3d550a534462aa665a11ac4412cc6d008b95"},"previous_names":["oldratlee/log4j2-mtc-thread-context-map"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Flog4j2-ttl-thread-context-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Flog4j2-ttl-thread-context-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Flog4j2-ttl-thread-context-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Flog4j2-ttl-thread-context-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oldratlee","download_url":"https://codeload.github.com/oldratlee/log4j2-ttl-thread-context-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332602,"owners_count":20921853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["context","log","log4j","log4j2","logging","logging-facilities","mapped-diagnostic-context","mdc","thread-context-map","transmittable-thread-local"],"created_at":"2024-10-12T15:04:51.634Z","updated_at":"2026-01-11T17:44:22.543Z","avatar_url":"https://github.com/oldratlee.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cdiv align=\"center\"\u003e🌳 Log4j2 TTL ThreadContextMap\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/oldratlee/log4j2-ttl-thread-context-map/actions/workflows/ci.yaml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/oldratlee/log4j2-ttl-thread-context-map/ci.yaml?branch=master\u0026logo=github\u0026logoColor=white\" alt=\"Github Workflow Build Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/oldratlee/log4j2-ttl-thread-context-map/branch/master\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/oldratlee/log4j2-ttl-thread-context-map/master?logo=codecov\u0026logoColor=white\" alt=\"Coverage Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://openjdk.java.net/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Java-6+-green?logo=openjdk\u0026logoColor=white\" alt=\"JDK support\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0.html\"\u003e\u003cimg src=\"https://img.shields.io/github/license/oldratlee/log4j2-ttl-thread-context-map?color=4D7A97\u0026logo=apache\" alt=\"License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://search.maven.org/artifact/com.alibaba/log4j2-ttl-thread-context-map\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/com.alibaba/log4j2-ttl-thread-context-map?color=2d545e\u0026logo=apache-maven\u0026logoColor=white\" alt=\"Maven Central\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/oldratlee/log4j2-ttl-thread-context-map/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/oldratlee/log4j2-ttl-thread-context-map\" alt=\"GitHub release\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/oldratlee/log4j2-ttl-thread-context-map/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/oldratlee/log4j2-ttl-thread-context-map\" alt=\"GitHub Stars\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/oldratlee/log4j2-ttl-thread-context-map/fork\"\u003e\u003cimg src=\"https://img.shields.io/github/forks/oldratlee/log4j2-ttl-thread-context-map\" alt=\"GitHub Forks\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/oldratlee/log4j2-ttl-thread-context-map/network/dependents\"\u003e\u003cimg src=\"https://badgen.net/github/dependents-repo/oldratlee/log4j2-ttl-thread-context-map?label=user%20repos\" alt=\"user repos\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/oldratlee/log4j2-ttl-thread-context-map\"\u003e\u003cimg src=\"https://img.shields.io/github/repo-size/oldratlee/log4j2-ttl-thread-context-map\" alt=\"GitHub repo size\"\u003e\u003c/a\u003e\n\u003ca href=\"https://gitpod.io/#https://github.com/oldratlee/log4j2-ttl-thread-context-map\"\u003e\u003cimg src=\"https://img.shields.io/badge/Gitpod-ready--to--code-green?label=gitpod\u0026logo=gitpod\u0026logoColor=white\" alt=\"gitpod: Ready to Code\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n--------------------------\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [🔧 Functions](#-functions)\n- [👥 Usage](#-usage)\n- [🏃 Run Demo](#-run-demo)\n- [🍪 Dependency](#-dependency)\n- [📚 Related resources](#-related-resources)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n--------------------------\n\n# 🔧 Functions\n\n👉 Enable the transmitting `Log4j2` `ThreadContext`(`ThreadLocal` value) between threads even using thread pooling components by [Transmittable ThreadLocal(`TTL`)](https://github.com/alibaba/transmittable-thread-local).\n\n\u003e From `v1.4+` upgrade to `Java 8`.  \n\u003e If you need `Java 6` support, use version `1.3.x` \u003ca href=\"https://search.maven.org/artifact/com.alibaba/log4j2-ttl-thread-context-map\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/com.alibaba/log4j2-ttl-thread-context-map?versionPrefix=1.3.\u0026color=lightgrey\u0026logo=apache-maven\u0026logoColor=white\" alt=\"Maven Central\"\u003e\u003c/a\u003e\n\n\n# 👥 Usage\n\nJust add this dependency into your project to activate the Log4j2 TTL ThreadContextMap. ✨\n\n# 🏃 Run Demo\n\nRun Demo Code\n\n```bash\n./mvnw clean test-compile -Dexec.classpathScope=test -Dexec.mainClass=com.alibaba.ttl.log4j2.Log4j2Demo exec:java\n\n./mvnw clean test-compile -Dexec.classpathScope=test -Dexec.mainClass=com.alibaba.ttl.log4j2.Slf4jMdcDemo exec:java\n```\n\n- [Log4j2Demo.java](src/test/java/com/alibaba/ttl/log4j2/Log4j2Demo.java)\n- [Slf4jMdcDemo.java](src/test/java/com/alibaba/ttl/log4j2/Slf4jMdcDemo.java)\n- [`TtlThreadContextMap` implementation class: TtlThreadContextMap.java](src/main/java/com/alibaba/ttl/log4j2/TtlThreadContextMap.java).\n\n# 🍪 Dependency\n\n```xml\n\u003c!--\n    because this dependency is implemented by log4j2 runtime extension\n    that will never be used by biz code,\n    set scope to *runtime*.\n--\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.alibaba\u003c/groupId\u003e\n    \u003cartifactId\u003elog4j2-ttl-thread-context-map\u003c/artifactId\u003e\n    \u003cversion\u003e1.4.0\u003c/version\u003e\n    \u003cscope\u003eruntime\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nFind up-to-date available versions at [search.maven.org](https://search.maven.org/artifact/com.alibaba/log4j2-ttl-thread-context-map).\n\n# 📚 Related resources\n\n- log4j2 documentation\n    - [log4j 2 Thread Context](https://logging.apache.org/log4j/2.x/manual/thread-context.html)\n    - [Changelog](https://logging.apache.org/log4j/2.x/changelog.html)\n- [Mapped Diagnostic Context (MDC) support - slf4j official documentation](https://www.slf4j.org/manual.html#mdc)\n- [Transmittable ThreadLocal(TTL)](https://github.com/alibaba/transmittable-thread-local), 📌 The missing Java™ std lib(simple \u0026 0-dependency) for framework/middleware, provide an enhanced InheritableThreadLocal that transmits ThreadLocal value between threads even using thread pooling components.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldratlee%2Flog4j2-ttl-thread-context-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foldratlee%2Flog4j2-ttl-thread-context-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldratlee%2Flog4j2-ttl-thread-context-map/lists"}