org.apache.jetspeed.services.logging
Class JetspeedLogger

java.lang.Object
  extended byorg.apache.jetspeed.services.logging.JetspeedLogger

public class JetspeedLogger
extends java.lang.Object

The implementation of loggers for Jetspeed. This class acts as a wrapper so that the underlying logging implementation is hidden fromthe rest of Jetspeed The current implementation uses Log4J.

Author:
Harald Ommang

Constructor Summary
JetspeedLogger(org.apache.log4j.Logger logger)
          Constructor.
 
Method Summary
 void debug(java.lang.Object obj)
          Logs the given object if debug is enabled
 void debug(java.lang.Object obj, java.lang.Throwable throwable)
          Logs the given object and throwable if debug is enabled
 void error(java.lang.Object obj)
          Logs the given object if error is enabled
 void error(java.lang.Object obj, java.lang.Throwable throwable)
          Logs the given object and throwable if error is enabled
 void fatal(java.lang.Object obj)
          Logs the given object if fatal is enabled
 void fatal(java.lang.Object obj, java.lang.Throwable throwable)
          Logs the given object and throwable if fatal is enabled
 void info(java.lang.Object obj)
          Logs the given object if info is enabled
 void info(java.lang.Object obj, java.lang.Throwable throwable)
          Logs the given object and throwable if info is enabled
 boolean isDebugEnabled()
          Checks if the current logger is enabled for debug logging.
 boolean isErrorEnabled()
          Checks if the current logger is enabled for error logging.
 boolean isFatalEnabled()
          Checks if the current logger is enabled for fatal logging.
 boolean isInfoEnabled()
          Checks if the current logger is enabled for info logging.
 boolean isTraceEnabled()
          Checks if the current logger is enabled for trace logging.
 boolean isWarnEnabled()
          Checks if the current logger is enabled for warning logging.
 void trace(java.lang.Object obj)
          Logs the given object if trace is enabled With Log4J, this is the same as debug
 void trace(java.lang.Object obj, java.lang.Throwable throwable)
          Logs the given object and throwable if trace is enabled With Log4J, this is the same as debug
 void warn(java.lang.Object obj)
          Logs the given object if warning is enabled
 void warn(java.lang.Object obj, java.lang.Throwable throwable)
          Logs the given object and throwable if warning is enabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JetspeedLogger

public JetspeedLogger(org.apache.log4j.Logger logger)
Constructor. Initialises this class with a given logger. If the logger is null, one is given named from this class.

Parameters:
logger - The logger to wrap
Method Detail

isDebugEnabled

public boolean isDebugEnabled()
Checks if the current logger is enabled for debug logging.

Returns:
true if debug is enabled

isErrorEnabled

public boolean isErrorEnabled()
Checks if the current logger is enabled for error logging.

Returns:
true if error is enabled

isFatalEnabled

public boolean isFatalEnabled()
Checks if the current logger is enabled for fatal logging.

Returns:
true if fatal is enabled

isInfoEnabled

public boolean isInfoEnabled()
Checks if the current logger is enabled for info logging.

Returns:
true if info is enabled

isTraceEnabled

public boolean isTraceEnabled()
Checks if the current logger is enabled for trace logging. Wtih log4J, this is the same as debug.

Returns:
true if trace is enabled

isWarnEnabled

public boolean isWarnEnabled()
Checks if the current logger is enabled for warning logging.

Returns:
true if warning is enabled

debug

public void debug(java.lang.Object obj)
Logs the given object if debug is enabled

Parameters:
obj - Object to log

debug

public void debug(java.lang.Object obj,
                  java.lang.Throwable throwable)
Logs the given object and throwable if debug is enabled

Parameters:
obj - Object to log
throwable - The underlying implementation may log stack trace for this

error

public void error(java.lang.Object obj)
Logs the given object if error is enabled

Parameters:
obj - Object to log

error

public void error(java.lang.Object obj,
                  java.lang.Throwable throwable)
Logs the given object and throwable if error is enabled

Parameters:
obj - Object to log
throwable - The underlying implementation may log stack trace for this

fatal

public void fatal(java.lang.Object obj)
Logs the given object if fatal is enabled

Parameters:
obj - Object to log

fatal

public void fatal(java.lang.Object obj,
                  java.lang.Throwable throwable)
Logs the given object and throwable if fatal is enabled

Parameters:
obj - Object to log
throwable - The underlying implementation may log stack trace for this

info

public void info(java.lang.Object obj)
Logs the given object if info is enabled

Parameters:
obj - Object to log

info

public void info(java.lang.Object obj,
                 java.lang.Throwable throwable)
Logs the given object and throwable if info is enabled

Parameters:
obj - Object to log
throwable - The underlying implementation may log stack trace for this

trace

public void trace(java.lang.Object obj)
Logs the given object if trace is enabled With Log4J, this is the same as debug

Parameters:
obj - Object to log

trace

public void trace(java.lang.Object obj,
                  java.lang.Throwable throwable)
Logs the given object and throwable if trace is enabled With Log4J, this is the same as debug

Parameters:
obj - Object to log
throwable - The underlying implementation may log stack trace for this

warn

public void warn(java.lang.Object obj)
Logs the given object if warning is enabled

Parameters:
obj - Object to log

warn

public void warn(java.lang.Object obj,
                 java.lang.Throwable throwable)
Logs the given object and throwable if warning is enabled

Parameters:
obj - Object to log
throwable - The underlying implementation may log stack trace for this


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.