com.webmethods.caf.wsclient.logging
Class GlueLogListener

java.lang.Object
  extended by com.webmethods.caf.wsclient.logging.GlueLogListener
All Implemented Interfaces:
ILogListener

public class GlueLogListener
extends Object
implements ILogListener

Wrapper for Glue logging subsystem. Provides ability to attach a electric.util.log.WriterLogger to write to the application provided Writer.


Field Summary
static String DEBUG
           
 
Fields inherited from interface com.webmethods.caf.wsclient.logging.ILogListener
ERROR, INFO
 
Constructor Summary
GlueLogListener()
           
 
Method Summary
static ILogger getDefaultLogger()
          Get the default electric.util.log.ILogger object that GLUE provides.
static ILogger getLogger(String name)
          Get the electric.util.log.ILogger object registered with the GLUE logging subsystem with the specified name.
static boolean isLogging(String category)
          Check if any registered loggers is logging the specified category
static void log(String category, Object message)
          Check if any registered loggers is logging the specified category and if so, log the message specified.
static void logDebug(String message)
          Log the verbose debug message
static void logDebug(String module, String message)
          Log the verbose debug message from the specified module.
static void logError(String message)
          Log the error message
static void logError(String module, String message)
          Log the error message from the specified module.
static void logException(String message, Throwable throwable)
          Log the Throwable from the specified module.
static void logException(Throwable throwable)
          Log the Throwable from the specified module.
static void logMapping(String message)
          Log the verbose mapping message
static void logMapping(String module, String message)
          Log the verbose mapping message from the specified module.
static void logNormal(String message)
          Log the normal message
static void logNormal(String module, String message)
          Log the normal message from the specified module.
static void logWarning(String message)
          Log the warning message
static void logWarning(String module, String message)
          Log the warning message from the specified module.
 void onLogEvent(String logMessage, String module, String category)
          Event handler method implementation of the ILogListener interface Category can be one of ILogListener.ERROR, ILogListener.DEBUG or ILogListener.INFO
 void onLogEvent(String category, String module, String logMessage, Throwable t)
          Event handler method implementation of the ILogListener interface Category can be one of ILogListener.ERROR, ILogListener.DEBUG or ILogListener.INFO
static void registerLogger(String name, Writer writer)
          Registers a electric.util.log.WriterLogger object with the GLUE logging subsystem.
static void startLogging(String category)
          Start logging the specified category
static void stopLogging(String category)
          Stop logging the specified category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final String DEBUG
See Also:
Constant Field Values
Constructor Detail

GlueLogListener

public GlueLogListener()
Method Detail

registerLogger

public static void registerLogger(String name,
                                  Writer writer)
                           throws Exception
Registers a electric.util.log.WriterLogger object with the GLUE logging subsystem. This is necessary only when an application needs to have a electric.util.log.ILogger that writes to a specific Writer. GLUE provides a default electric.util.log.ILogger that writes to the console.

Parameters:
name - the name of the electric.util.log.WriterLogger object
writer - the Writer object
Throws:
Exception

getLogger

public static ILogger getLogger(String name)
Get the electric.util.log.ILogger object registered with the GLUE logging subsystem with the specified name.

Parameters:
name - the name of the electric.util.log.ILogger object
Returns:
the electric.util.log.ILogger object

getDefaultLogger

public static ILogger getDefaultLogger()
Get the default electric.util.log.ILogger object that GLUE provides.

Returns:
the default electric.util.log.ILogger object

isLogging

public static boolean isLogging(String category)
Check if any registered loggers is logging the specified category

Parameters:
category - the logging category
Returns:
true if the specified category is enabled for logging

startLogging

public static void startLogging(String category)
Start logging the specified category

Parameters:
category - the logging category

stopLogging

public static void stopLogging(String category)
Stop logging the specified category

Parameters:
category - the logging category

log

public static void log(String category,
                       Object message)
Check if any registered loggers is logging the specified category and if so, log the message specified.

Parameters:
category - the logging category
message - the log message

logError

public static void logError(String module,
                            String message)
Log the error message from the specified module.

Parameters:
module - name of the module logging the message
message - the log message

logError

public static void logError(String message)
Log the error message

Parameters:
message - the log message

logException

public static void logException(String message,
                                Throwable throwable)
Log the Throwable from the specified module.

Parameters:
message - the log message
throwable - the Throwable object

logException

public static void logException(Throwable throwable)
Log the Throwable from the specified module.

Parameters:
throwable - the Throwable object

logWarning

public static void logWarning(String module,
                              String message)
Log the warning message from the specified module.

Parameters:
module - name of the module logging the message
message - the log message

logWarning

public static void logWarning(String message)
Log the warning message

Parameters:
message - the log message

logNormal

public static void logNormal(String module,
                             String message)
Log the normal message from the specified module.

Parameters:
module - name of the module logging the message
message - the log message

logNormal

public static void logNormal(String message)
Log the normal message

Parameters:
message - the log message

logDebug

public static void logDebug(String module,
                            String message)
Log the verbose debug message from the specified module.

Parameters:
module - name of the module logging the message
message - the log message

logDebug

public static void logDebug(String message)
Log the verbose debug message

Parameters:
message - the log message

logMapping

public static void logMapping(String module,
                              String message)
Log the verbose mapping message from the specified module.

Parameters:
module - name of the module logging the message
message - the log message

logMapping

public static void logMapping(String message)
Log the verbose mapping message

Parameters:
message - the log message

onLogEvent

public void onLogEvent(String logMessage,
                       String module,
                       String category)
Description copied from interface: ILogListener
Event handler method implementation of the ILogListener interface Category can be one of ILogListener.ERROR, ILogListener.DEBUG or ILogListener.INFO

Specified by:
onLogEvent in interface ILogListener
Parameters:
logMessage - the serverity
module - the originating class / module
category - the message details

onLogEvent

public void onLogEvent(String category,
                       String module,
                       String logMessage,
                       Throwable t)
Description copied from interface: ILogListener
Event handler method implementation of the ILogListener interface Category can be one of ILogListener.ERROR, ILogListener.DEBUG or ILogListener.INFO

Specified by:
onLogEvent in interface ILogListener
Parameters:
category - the serverity
module - the originating class / module
logMessage - the message details
t - the exception