Affects: 5.2.6.RELEASE
The current implementation of DefaultClientResponseBuilder doesn't allow a logPrefix to be specified for the DefaultClientResponse that is being builded, neither transfer the logPrefix when an instance is builded from another DefaultClientResponse.
This is a problem for spring-cloud-sleuth, that wraps and mutates DefaultClientResponses, and doing so, the logPrefix is replaced by an empty string on the new instance.
I also opened an issue on the spring-cloud-sleuth project, that explains the use case and contains a project that simulates the problem: https://github.com/spring-cloud/spring-cloud-sleuth/issues/1591
The logPrefix() on ClientResponse was added relatively recently in 09b6730f3d89b55819ea9bea66314269b7cc4fd9 and indeed it should be copied.
Most helpful comment
The
logPrefix()onClientResponsewas added relatively recently in 09b6730f3d89b55819ea9bea66314269b7cc4fd9 and indeed it should be copied.