Class LogHandler
java.lang.Object
com.webmethods.caf.wsclient.logging.LogHandler
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(ILogListener listener) Add aILogListener
implementation to the list of listeners notified when a logging event is fire.void
fireLogEvent
(String category, String module, String logMessage) Fire a logging event, notifying all each of our registered log listenersvoid
fireLogEvent
(String category, String module, String logMessage, Throwable t) Fire an exception logging event, notifying all each of our registered log listenersstatic LogHandler
Get the singleton instance of the LogHandlerstatic void
Convenience method for generating a debug logging message error for the given modulestatic void
Convenience method for logging an error for the given modulestatic void
logException
(String module, String logMessage, Throwable throwable) Convenience method for generating an error logging message for a given exceptionvoid
removeListener
(ILogListener listener) Remove a specificILogListener
implementation from the list of listenersstatic void
shutdown()
-
Field Details
-
m_logHandler
-
m_listenerList
-
-
Constructor Details
-
LogHandler
public LogHandler()
-
-
Method Details
-
getInstance
Get the singleton instance of the LogHandler- Returns:
- singleton instance of
LogHandler
-
shutdown
public static void shutdown() -
fireLogEvent
Fire a logging event, notifying all each of our registered log listeners- Parameters:
category
- the log category as stringmodule
- the logging module as stringlogMessage
- the message to add to the log
-
fireLogEvent
Fire an exception logging event, notifying all each of our registered log listeners- Parameters:
category
- the log category as stringcategory
- the log category as stringmodule
- the logging module as stringlogMessage
- the message to add to the logt
- the thrown exception as Throwable
-
addListener
Add aILogListener
implementation to the list of listeners notified when a logging event is fire.- Parameters:
listener
- theILogListener
implementation to be notified of logging events
-
removeListener
Remove a specificILogListener
implementation from the list of listeners- Parameters:
listener
- theILogListener
implementation to be notified of logging events
-
logError
Convenience method for logging an error for the given module- Parameters:
module
- the module that generated the errorlogMessage
- the error message as string
-
logDebug
Convenience method for generating a debug logging message error for the given module- Parameters:
module
- the module that generated the messagelogMessage
- the debug message as string
-
logException
Convenience method for generating an error logging message for a given exception- Parameters:
module
- the module that generated the errorlogMessage
- the debug message as stringthrowable
- the exception to be logged
-