Class LogHandler

java.lang.Object
com.webmethods.caf.wsclient.logging.LogHandler

public class LogHandler extends Object
Log Handler for WSClient. Log events are delivered to registered listeners that implement the ILogListener interface. Listeners are registered via the WSClient.addLogListener() convenience method
  • Field Details

  • Constructor Details

    • LogHandler

      public LogHandler()
  • Method Details

    • getInstance

      public static LogHandler getInstance()
      Get the singleton instance of the LogHandler
      Returns:
      singleton instance of LogHandler
    • shutdown

      public static void shutdown()
    • fireLogEvent

      public void fireLogEvent(String category, String module, String logMessage)
      Fire a logging event, notifying all each of our registered log listeners
      Parameters:
      category - the log category as string
      module - the logging module as string
      logMessage - the message to add to the log
    • fireLogEvent

      public void fireLogEvent(String category, String module, String logMessage, Throwable t)
      Fire an exception logging event, notifying all each of our registered log listeners
      Parameters:
      category - the log category as string
      category - the log category as string
      module - the logging module as string
      logMessage - the message to add to the log
      t - the thrown exception as Throwable
    • addListener

      public void addListener(ILogListener listener)
      Add a ILogListener implementation to the list of listeners notified when a logging event is fire.
      Parameters:
      listener - the ILogListener implementation to be notified of logging events
    • removeListener

      public void removeListener(ILogListener listener)
      Remove a specific ILogListener implementation from the list of listeners
      Parameters:
      listener - the ILogListener implementation to be notified of logging events
    • logError

      public static void logError(String module, String logMessage)
      Convenience method for logging an error for the given module
      Parameters:
      module - the module that generated the error
      logMessage - the error message as string
    • logDebug

      public static void logDebug(String module, String logMessage)
      Convenience method for generating a debug logging message error for the given module
      Parameters:
      module - the module that generated the message
      logMessage - the debug message as string
    • logException

      public static void logException(String module, String logMessage, Throwable throwable)
      Convenience method for generating an error logging message for a given exception
      Parameters:
      module - the module that generated the error
      logMessage - the debug message as string
      throwable - the exception to be logged