Class 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

      Constructors 
      Constructor Description
      LoggingInterceptor()
      Constructor for client logging interceptor
      LoggingInterceptor​(boolean theVerbose)
      Constructor for client logging interceptor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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).
      void setLogRequestBody​(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information
      void setLogRequestHeaders​(boolean theValue)
      Should headers for each request be logged, containing the URL and other information
      void setLogRequestSummary​(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information
      void setLogResponseBody​(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information
      void setLogResponseHeaders​(boolean theValue)
      Should headers for each request be logged, containing the URL and other information
      void setLogResponseSummary​(boolean theValue)
      Should a summary (one line) for each request be logged, containing the URL and other information
    • Constructor Detail

      • LoggingInterceptor

        public 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 Detail

      • 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 void setLogRequestBody​(boolean theValue)
        Should a summary (one line) for each request be logged, containing the URL and other information
      • setLogRequestHeaders

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

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

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

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

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