org.springframework.http.client.ClientHttpRequestInterceptorpublic class LoggingInterceptor
extends java.lang.Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
ClientHttpRequestInterceptor: Logging| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
LoggingInterceptor.InternalLogger |
Internal
Logger |
| Constructor | Description |
|---|---|
LoggingInterceptor(org.slf4j.Logger logger) |
Constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
org.springframework.http.client.ClientHttpResponse |
intercept(org.springframework.http.HttpRequest request,
byte[] body,
@NonNull org.springframework.http.client.ClientHttpRequestExecution execution) |
|
protected void |
logRequest(@NonNull org.springframework.http.HttpRequest request,
@lombok.NonNull byte[] body) |
Log request
|
protected void |
logResponse(@NonNull ContentCachingClientHttpResponse response) |
Log response
|
public LoggingInterceptor(org.slf4j.Logger logger)
logger - Loggerpublic org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request,
byte[] body,
@NonNull
@NonNull org.springframework.http.client.ClientHttpRequestExecution execution)
throws java.io.IOException
intercept in interface org.springframework.http.client.ClientHttpRequestInterceptorjava.io.IOExceptionprotected void logRequest(@NonNull
@NonNull org.springframework.http.HttpRequest request,
@NonNull
@lombok.NonNull byte[] body)
request - HttpRequestbody - bodyprotected void logResponse(@NonNull
@NonNull ContentCachingClientHttpResponse response)
throws java.io.IOException
response - ContentCachingClientHttpResponsejava.io.IOException - if failed to get statusCopyright © 2017–2018 SPT. All rights reserved.