OpenFeign / OpenFeign/feign

feign capabilities not support multiple feign.Logger Logger

Open
#2,794 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

feign.client.config.default.capabilities[0]=com.google.ACapability
feign.client.config.default.capabilities[1]=com.google.BCapability

this config.
code detail demo:

public class ACapability implements Capability {
   @Override
    public Logger enrich(Logger logger) {
        return new ALogger(logger);
    }
}

public class BCapability implements Capability {
    @Override
    public Logger enrich(CustomLogger logger) { 
        return new BLogger(logger);
    }
}

public class ALogger extends feign.Logger {

   @Override
    protected Response logAndRebufferResponse(String configKey, Level logLevel, Response response, long elapsedTime) {
         // todo print message
    }
}

public class BLogger extends feign.Logger {

   @Override
    protected Response logAndRebufferResponse(String configKey, Level logLevel, Response response, long elapsedTime) {
         // todo print message
    }
}

The only thing that will be effective is com.google.BCapability

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the configured capabilities are applied and how Capability.enrich(Logger) is invoked for the two examples. Check the logger configuration path and existing tests around capability enrichment. Done means both configured capabilities affect the resulting feign.Logger, with coverage for the ACapability and BCapability sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.