You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Access to request, as well as response headers when response status != 2XX #396
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?
Thanks Adrian, #290 sounds reasonable as far as I understand it.
But what about changing the signature of feign.codec.ErrorDecoder.decode to Exception decode(Request request, Response response); ? Then implementors would have access to the full request for e.g. logging purposes, or using in a resulting exception.
I think it should be possible to do this in a backwards compatible fashion in Java 8, with the use of a default forwarding implementation of the original method, but it seems like the source version is at 1.6 currently..
basically you've got it. even if we said the async problem isn't one we'd
want to address, we'd have to break api one way or another (ie source to
java 8 is an incompatible move). Bumping the major version is the only way
I can see out of this.
Activity
codefromthecrypt commentedon May 25, 2016
This topic has come up a few times, and usually ends when I ask someone to review the history first :)
Have a look through #290? If you can take the conversation forward with that in mind.. all ears!
colsson11 commentedon Jun 2, 2016
Thanks Adrian, #290 sounds reasonable as far as I understand it.
But what about changing the signature of
feign.codec.ErrorDecoder.decodetoException decode(Request request, Response response);? Then implementors would have access to the full request for e.g. logging purposes, or using in a resulting exception.I think it should be possible to do this in a backwards compatible fashion in Java 8, with the use of a default forwarding implementation of the original method, but it seems like the source version is at 1.6 currently..
codefromthecrypt commentedon Jun 3, 2016
colsson11 commentedon Jun 10, 2016
Thanks, yeah I guess when the times comes for a major version upgrade, either of these would be nice :)
spencergibb commentedon Jun 10, 2016
fwiw, spring cloud won't move to java 8 until spring 5 and boot 2
davejwilson commentedon Sep 23, 2016
is this still a limitation of feign?
spencergibb commentedon Oct 5, 2016
@davejwilson yes
kdavisk6 commentedon Jul 20, 2018
see #744 for an update on this. The
Requestwill be available, albeit sans body, on theResponse.kdavisk6 commentedon May 28, 2019
Closed via #744