Skip to content

Access to request, as well as response headers when response status != 2XX #396

@colsson11

Description

@colsson11

Hi there,

I would like to be able to log the full request, including headers, in addition to response, when a response returns something other than 2XX, to be able to fully debug what is going on.

I can turn on logging, but as far as I can tell in feign.SynchronousMethodHandler , it's not possible to get it to only log in the case of failed requests. Logging all requests will mean a lot of noise.

Another option would be if the errorDecoder method feign.codec.ErrorDecoder.decode got the request passed in as well, so this could be used in a custom ErrorDecoder. A potential difficulty here would be to make this backwards compatible.

Are you open for a pull request addressing this in either way above, or maybe there is some way to achieve this that I've overlooked?

Cheers,

Christian

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationIssues that require updates to our documentationenhancementFor recommending new capabilitieshelp wantedIssues we need help with tackling

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions