Skip to content
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

loggerLevel > NONE not working on partial request (206) #1134

Closed
bananaspliff opened this issue Dec 17, 2019 · 2 comments
Closed

loggerLevel > NONE not working on partial request (206) #1134

bananaspliff opened this issue Dec 17, 2019 · 2 comments
Labels
feedback provided Feedback has been provided to the author

Comments

@bananaspliff
Copy link

bananaspliff commented Dec 17, 2019

the bug appear only if you have a specific logger in DEBUG like this :

@Component
public class FeignLogger extends Logger {

	@Override
	protected Response logAndRebufferResponse(String configKey, Level logLevel, Response response, long elapsedTime) {
		// NOOP
		return response;
	}

	@Override
	protected void log(String configKey, String format, Object... args) {
		// NOOP
	}

	@Bean
	public Level defaultFeignLogger() {
		return BASIC;
	}

}
DEBUG XXX.26 - exiting logAndRebufferResponse with result HTTP/1.1 206 Partial Content
content-type: application/json;charset=utf-8
server: Jetty(9.4.24.v20191120)
transfer-encoding: chunked
feign.Response$InputStreamBody@71ace013 .  
16:30:07.301 [main] DEBUG XXX.FeignLogger:63 - [XXX] <--- ERROR IOException: stream is closed (227ms)

works with Feign 10.1 and not working with Feign 10.4

@kdavisk6
Copy link
Member

This is because the logger you have implemented violates the Logger contract. The method logAndRebufferResponse expects that the Response returns contains an InputStream that can be read again. This is required since logAndRebufferResponse is called before the Response is processed.

Please refer to the default Logger implementation for an example.

@kdavisk6 kdavisk6 added the feedback provided Feedback has been provided to the author label Dec 26, 2019
@bananaspliff
Copy link
Author

oh my bad ! there is a code that displays the whole object with aspect !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback provided Feedback has been provided to the author
Projects
None yet
Development

No branches or pull requests

2 participants