Expose logPrefix in ClientResponse
This commit exposes the logPrefix field in the ClientResponse interface. Closes gh-24146
This commit is contained in:
parent
63844c6d74
commit
09b6730f3d
|
@ -204,6 +204,19 @@ public interface ClientResponse {
|
||||||
*/
|
*/
|
||||||
Mono<WebClientResponseException> createException();
|
Mono<WebClientResponseException> createException();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a log message prefix to use to correlate messages for this response.
|
||||||
|
* The prefix is based on the {@linkplain ClientRequest#logPrefix() client
|
||||||
|
* log prefix}, which itself is based on the value of the request attribute
|
||||||
|
* {@link ClientRequest#LOG_ID_ATTRIBUTE} along with some extra formatting
|
||||||
|
* so that the prefix can be conveniently prepended with no further
|
||||||
|
* formatting no separators required.
|
||||||
|
* @return the log message prefix or an empty String if the
|
||||||
|
* {@link ClientRequest#LOG_ID_ATTRIBUTE} was not set.
|
||||||
|
* @since 5.2.3
|
||||||
|
*/
|
||||||
|
String logPrefix();
|
||||||
|
|
||||||
|
|
||||||
// Static builder methods
|
// Static builder methods
|
||||||
|
|
||||||
|
|
|
@ -225,6 +225,11 @@ class DefaultClientResponse implements ClientResponse {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String logPrefix() {
|
||||||
|
return this.logPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
// Used by DefaultClientResponseBuilder
|
// Used by DefaultClientResponseBuilder
|
||||||
HttpRequest request() {
|
HttpRequest request() {
|
||||||
return this.requestSupplier.get();
|
return this.requestSupplier.get();
|
||||||
|
|
|
@ -153,6 +153,11 @@ public class ClientResponseWrapper implements ClientResponse {
|
||||||
return this.delegate.createException();
|
return this.delegate.createException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String logPrefix() {
|
||||||
|
return this.delegate.logPrefix();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of the {@code Headers} interface that can be subclassed
|
* Implementation of the {@code Headers} interface that can be subclassed
|
||||||
* to adapt the headers in a
|
* to adapt the headers in a
|
||||||
|
|
Loading…
Reference in New Issue