Class RESTCallLogger

java.lang.Object
org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger

public class RESTCallLogger extends 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 Details

    • RESTCallLogger

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

    • logRESTCall

      public RESTCallToken logRESTCall(String serverName, String userId, 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
    • logRESTCall

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

      public void setUserId(RESTCallToken token, String userId)
      Allow the userId to be added retrospectively
      Parameters:
      token - REST call token
      userId - calling user
    • logRESTCallReturn

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