Skip to content

add support for peekByKey in MDCAdapter #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

youjie23
Copy link

@youjie23 youjie23 commented May 21, 2025

fixed #461 add support for peekByKey in MDCAdapter
1、add peekByKey in MDCAdapter with default implement
2、add peekByKey in ThreadLocalMapOfStacks and BasicMDCAdapter

@youjie23 youjie23 force-pushed the master branch 3 times, most recently from 9f6e4d6 to 46b53f6 Compare May 21, 2025 10:21
Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me, so I’d like to express my (non-binding) support for including them in SLF4J.

The absence of a peekByKey method in ThreadLocalMapOfStacks was the primary reason I had to reimplement this functionality in log4j-slf4j2-impl, so this addition is particularly welcome.

One question I have is about versioning: how are these changes intended to be adopted by implementors? As I understand it, SLF4J 2.0 implementations are expected to maintain compatibility with all 2.x versions starting from 2.0.0. Would it be more appropriate for these changes to be introduced in 2.1.0, so that only implementations explicitly targeting 2.1.x can use them?

@youjie23 youjie23 changed the title add support for peekByKey in MDC add support for peekByKey in MDCAdapter May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for peekByKey in MDC
2 participants