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 Details

    • LoggingInterceptor

      Constructor for client logging interceptor
    • LoggingInterceptor

      public LoggingInterceptor(boolean theVerbose)
      Constructor for client logging interceptor
      Parameters:
      theVerbose - If set to true, all logging is enabled
  • Method Details

    • interceptRequest

      public void interceptRequest(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest)
      Specified by:
      interceptRequest in interface ca.uhn.fhir.rest.client.api.IClientInterceptor
    • interceptResponse

      public void interceptResponse(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse) throws IOException
      Specified by:
      interceptResponse in interface ca.uhn.fhir.rest.client.api.IClientInterceptor
      Throws:
      IOException
    • setLogger

      public void setLogger(org.slf4j.Logger theLogger)
      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

      public LoggingInterceptor setLogRequestBody(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information
    • setLogRequestHeaders

      public LoggingInterceptor setLogRequestHeaders(boolean theValue)
      Should headers for each request be logged, containing the URL and other information
    • setLogRequestSummary

      public LoggingInterceptor setLogRequestSummary(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information
    • setLogResponseBody

      public LoggingInterceptor setLogResponseBody(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information
    • setLogResponseHeaders

      public LoggingInterceptor setLogResponseHeaders(boolean theValue)
      Should headers for each request be logged, containing the URL and other information
    • setLogResponseSummary

      public LoggingInterceptor setLogResponseSummary(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information