Skip to content

Conversation

@davidmc24
Copy link
Contributor

Adds a new "slf4j" module. A few methods in Logger are now protected rather
than package protected to allow access by Logger subclasses that aren't
inner classes of Logger.

@cloudbees-pull-request-builder

feign-pull-requests #129 SUCCESS
This pull request looks good

@davidmc24
Copy link
Contributor Author

I considered adding support for the SLF4J MDC. My conclusion was that the right way to integrate that would be at a different level than the Logger implementation, and thus should be treated as a separate feature.

Ideally, the MDC entries would be set once at the beginning of handling a request/response/retry loop, and cleared at the end (possibly with some additional keys per-response/retry). Otherwise, there's the possibility that some logging entries would have the MDC properly set, and others wouldn't. Good examples of things that might be "missed" are retry messages and IO exceptions. Currently, the only place to integrate at this level would be within SynchronousMethodHandler. To do this properly, I think we'd either need to adopt SLF4J as our only logging library (and likely eliminate our current Logger extension point) or introduce a new extension point that provides the desired hooks.

@codefromthecrypt
Copy link
Contributor

Good work, and thanks for explaining the rationale on MDC.

@codefromthecrypt
Copy link
Contributor

Can you rebase this so that I can click merge? :)

Adds a new "slf4j" module.  A few methods in Logger are now protected rather
than package protected to allow access by Logger subclasses that aren't
inner classes of Logger.
@davidmc24
Copy link
Contributor Author

@adriancole rebased

@cloudbees-pull-request-builder

feign-pull-requests #131 SUCCESS
This pull request looks good

codefromthecrypt pushed a commit that referenced this pull request Dec 29, 2013
slf4j: add slf4j integration module (#94)
@codefromthecrypt codefromthecrypt merged commit 93447c6 into OpenFeign:master Dec 29, 2013
@davidmc24 davidmc24 deleted the feature/slf4j branch December 29, 2013 06:14
@davidmc24 davidmc24 mentioned this pull request Feb 18, 2014
velo pushed a commit that referenced this pull request Oct 8, 2024
slf4j: add slf4j integration module (#94)
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.

3 participants