Class RESTCallLogger


  • public class RESTCallLogger
    extends java.lang.Object
    RESTCallLogger provides standard logging for REST API method invocations. It logs the start and end of the call and manages a timer so that the elapsed time of a call is logged.
    • Constructor Summary

      Constructors 
      Constructor Description
      RESTCallLogger​(org.slf4j.Logger log, java.lang.String serviceName)
      Create a REST Call logger for a REST Service.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RESTCallToken logRESTCall​(java.lang.String serverName, java.lang.String userId, java.lang.String methodName)
      Log the start of an inbound REST Call.
      void logRESTCallReturn​(RESTCallToken token, java.lang.String response)
      Log the return of an inbound REST Call.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RESTCallLogger

        public RESTCallLogger​(org.slf4j.Logger log,
                              java.lang.String serviceName)
        Create a REST Call logger for a REST Service.
        Parameters:
        log - debug logger
        serviceName - service name
    • Method Detail

      • logRESTCall

        public RESTCallToken logRESTCall​(java.lang.String serverName,
                                         java.lang.String userId,
                                         java.lang.String methodName)
        Log the start of an inbound REST Call.
        Parameters:
        serverName - destination server
        userId - calling user
        methodName - called method
        Returns:
        stop watch measuring the call execution length
      • logRESTCallReturn

        public void logRESTCallReturn​(RESTCallToken token,
                                      java.lang.String response)
        Log the return of an inbound REST Call.
        Parameters:
        token - REST call token
        response - result of call