org.chwf.plugin
Class Logger

java.lang.Object
  |
  +--org.chwf.plugin.Logger
Direct Known Subclasses:
DefaultLogger

public abstract class Logger
extends java.lang.Object

An abstract superclass for custom logging. The default logger uses the (crude) logging utilities defined in the Servlet API; a custom Logger plugin can be used to switch this out for Log4J or the JDK 1.4 logging API. This plugin is not intended to be a full-featured logging API; it is simply a minimalist logging API to support integrating Chrysalis logging with more advanced logging frameworks.

Author:
Paul Strack

Field Summary
static java.lang.String LOGGER_ID
          Id for the logger plugin in the config file.
 
Constructor Summary
protected Logger()
          No-op constructor.
 
Method Summary
 void debug(java.lang.Class context, java.lang.Object message)
          Log the message at the debug level.
 void debug(java.lang.Class context, java.lang.Object message, java.lang.Throwable ex)
          Log the message at the debug level.
static Logger getInstance()
          Returns the Logger object.
 void log(java.lang.Class context, java.lang.Object message)
          Log the message.
 void log(java.lang.Class context, java.lang.Object message, java.lang.Throwable ex)
          Log the message.
protected abstract  void log(java.lang.Class context, java.lang.Object message, java.lang.Throwable ex, boolean debug)
          Log the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER_ID

public static final java.lang.String LOGGER_ID
Id for the logger plugin in the config file.
Constructor Detail

Logger

protected Logger()
No-op constructor.
Method Detail

getInstance

public static Logger getInstance()
Returns the Logger object.

Returns:
The logger.

debug

public void debug(java.lang.Class context,
                  java.lang.Object message)
Log the message at the debug level.

Parameters:
context - The context class for the log message.
message - The message (string value is logged).

debug

public void debug(java.lang.Class context,
                  java.lang.Object message,
                  java.lang.Throwable ex)
Log the message at the debug level.

Parameters:
context - The context class for the log message.
message - The message (string value is logged).
ex - The exception (logs the stack-trace).

log

public void log(java.lang.Class context,
                java.lang.Object message)
Log the message.

Parameters:
context - The context class for the log message.
message - The message (string value is logged).

log

public void log(java.lang.Class context,
                java.lang.Object message,
                java.lang.Throwable ex)
Log the message.

Parameters:
context - The context class for the log message.
message - The message (string value is logged).
ex - The exception (logs the stack-trace).

log

protected abstract void log(java.lang.Class context,
                            java.lang.Object message,
                            java.lang.Throwable ex,
                            boolean debug)
Log the message. This method must be overridden by custom subclasses.

Parameters:
context - The context class for the log message.
message - The message (string value is logged).
ex - The exception: logs the stack-trace (may be null).
debug - True if logged at the debug level.


Copyright © 2002-2004, Paul Strack. All Rights Reserved.