Class LoggingInterceptor
java.lang.Object
ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor
- All Implemented Interfaces:
ca.uhn.fhir.rest.client.api.IClientInterceptor
public class LoggingInterceptor
extends Object
implements ca.uhn.fhir.rest.client.api.IClientInterceptor
-
Constructor Summary
ConstructorDescriptionConstructor for client logging interceptorLoggingInterceptor
(boolean theVerbose) Constructor for client logging interceptor -
Method Summary
Modifier and TypeMethodDescriptionvoid
interceptRequest
(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest) void
interceptResponse
(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse) void
setLogger
(org.slf4j.Logger theLogger) Sets a logger to use to log messages (default is a logger with this class' name).setLogRequestBody
(boolean theValue) Should a summary (one line) for each request be logged, containing the URL and other informationsetLogRequestHeaders
(boolean theValue) Should headers for each request be logged, containing the URL and other informationsetLogRequestSummary
(boolean theValue) Should a summary (one line) for each request be logged, containing the URL and other informationsetLogResponseBody
(boolean theValue) Should a summary (one line) for each request be logged, containing the URL and other informationsetLogResponseHeaders
(boolean theValue) Should headers for each request be logged, containing the URL and other informationsetLogResponseSummary
(boolean theValue) Should a summary (one line) for each request be logged, containing the URL and other information
-
Constructor Details
-
LoggingInterceptor
public LoggingInterceptor()Constructor for client logging interceptor -
LoggingInterceptor
Constructor for client logging interceptor- Parameters:
theVerbose
- If set to true, all logging is enabled
-
-
Method Details
-
interceptRequest
- Specified by:
interceptRequest
in interfaceca.uhn.fhir.rest.client.api.IClientInterceptor
-
interceptResponse
public void interceptResponse(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse) throws IOException - Specified by:
interceptResponse
in interfaceca.uhn.fhir.rest.client.api.IClientInterceptor
- Throws:
IOException
-
setLogger
Sets a logger to use to log messages (default is a logger with this class' name). This can be used to redirect logs to a differently named logger instead.- Parameters:
theLogger
- The logger to use. Must not be null.
-
setLogRequestBody
Should a summary (one line) for each request be logged, containing the URL and other information -
setLogRequestHeaders
Should headers for each request be logged, containing the URL and other information -
setLogRequestSummary
Should a summary (one line) for each request be logged, containing the URL and other information -
setLogResponseBody
Should a summary (one line) for each request be logged, containing the URL and other information -
setLogResponseHeaders
Should headers for each request be logged, containing the URL and other information -
setLogResponseSummary
Should a summary (one line) for each request be logged, containing the URL and other information
-