Package uk.ac.gda.ui.tool.rest
Class LoggingInterceptor
java.lang.Object
uk.ac.gda.ui.tool.rest.LoggingInterceptor
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
public class LoggingInterceptor
extends Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
Intercepts http communication in order
- Logs the request body, if the logger is in debug mode.
- Submits the request to the endpoint.
- Logs the response body, If the logger is in debug mode.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest req, byte[] reqBody, org.springframework.http.client.ClientHttpRequestExecution ex)
-
Constructor Details
-
LoggingInterceptor
public LoggingInterceptor()
-
-
Method Details
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest req, byte[] reqBody, org.springframework.http.client.ClientHttpRequestExecution ex) throws IOException - Specified by:
interceptin interfaceorg.springframework.http.client.ClientHttpRequestInterceptor- Throws:
IOException
-