com.webmethods.caf.wsclient.logging
Class LogHandler

java.lang.Object
  extended by 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 Summary
protected  ArrayList m_listenerList
           
protected static LogHandler m_logHandler
           
 
Constructor Summary
LogHandler()
           
 
Method Summary
 void addListener(ILogListener listener)
          Add a ILogListener 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 listeners
 void fireLogEvent(String category, String module, String logMessage, Throwable t)
          Fire an exception logging event, notifying all each of our registered log listeners
static LogHandler getInstance()
          Get the singleton instance of the LogHandler
static void logDebug(String module, String logMessage)
          Convenience method for generating a debug logging message error for the given module
static void logError(String module, String logMessage)
          Convenience method for logging an error for the given module
static void logException(String module, String logMessage, Throwable throwable)
          Convenience method for generating an error logging message for a given exception
 void removeListener(ILogListener listener)
          Remove a specific ILogListener implementation from the list of listeners
static void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_logHandler

protected static LogHandler m_logHandler

m_listenerList

protected ArrayList m_listenerList
Constructor Detail

LogHandler

public LogHandler()
Method Detail

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