org.tuckey.utils
Class Log

java.lang.Object
  extended byorg.tuckey.utils.Log

public class Log
extends java.lang.Object

Log copies the style of commons logging. The only reason this exists is that many problems were had with Log4j and commons-logging interfering with peoples installed configuration. It is very easy to change this to log4j or commons-logging in the future.

Version:
$Revision: 1.6 $ $Date: 2005/04/02 11:21:50 $
Author:
Paul Tuckey

Constructor Summary
Log(java.lang.Class clazz)
           
 
Method Summary
 void debug(java.lang.Object o)
           
 void debug(java.lang.Object o, java.lang.Throwable throwable)
           
 void debug(java.lang.Throwable throwable)
           
 void error(java.lang.Object o)
           
 void error(java.lang.Object o, java.lang.Throwable throwable)
           
 void error(java.lang.Throwable throwable)
           
 void fatal(java.lang.Object o)
           
 void fatal(java.lang.Object o, java.lang.Throwable throwable)
           
 void fatal(java.lang.Throwable throwable)
           
static Log getLog(java.lang.Class aClass)
          Will get an instance of log for a given class.
 void info(java.lang.Object o)
           
 void info(java.lang.Object o, java.lang.Throwable throwable)
           
 void info(java.lang.Throwable throwable)
           
 boolean isDebugEnabled()
           
 boolean isErrorEnabled()
           
 boolean isFatalEnabled()
           
 boolean isInfoEnabled()
           
 boolean isTraceEnabled()
           
 boolean isWarnEnabled()
           
static void resetAll()
          Resets log to default state.
static void setConfiguration(javax.servlet.FilterConfig filterConfig)
          Will setup Log based on the filter config.
static void setLevel(java.lang.String level)
          Set the logging level (options are TRACE, DEBUG, INFO, WARN, ERROR, FATAL).
static void setLogToSystemOut(boolean logToSystemOut)
          If set to true will cause the logger to log to system.out as well as context.log.
 void trace(java.lang.Object o)
           
 void trace(java.lang.Object o, java.lang.Throwable throwable)
           
 void trace(java.lang.Throwable throwable)
           
 void warn(java.lang.Object o)
           
 void warn(java.lang.Object o, java.lang.Throwable throwable)
           
 void warn(java.lang.Throwable throwable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log

public Log(java.lang.Class clazz)
Method Detail

isTraceEnabled

public boolean isTraceEnabled()

isDebugEnabled

public boolean isDebugEnabled()

isInfoEnabled

public boolean isInfoEnabled()

isWarnEnabled

public boolean isWarnEnabled()

isErrorEnabled

public boolean isErrorEnabled()

isFatalEnabled

public boolean isFatalEnabled()

trace

public void trace(java.lang.Object o)

trace

public void trace(java.lang.Object o,
                  java.lang.Throwable throwable)

trace

public void trace(java.lang.Throwable throwable)

debug

public void debug(java.lang.Object o)

debug

public void debug(java.lang.Object o,
                  java.lang.Throwable throwable)

debug

public void debug(java.lang.Throwable throwable)

info

public void info(java.lang.Object o)

info

public void info(java.lang.Object o,
                 java.lang.Throwable throwable)

info

public void info(java.lang.Throwable throwable)

warn

public void warn(java.lang.Object o)

warn

public void warn(java.lang.Object o,
                 java.lang.Throwable throwable)

warn

public void warn(java.lang.Throwable throwable)

error

public void error(java.lang.Object o)

error

public void error(java.lang.Object o,
                  java.lang.Throwable throwable)

error

public void error(java.lang.Throwable throwable)

fatal

public void fatal(java.lang.Object o)

fatal

public void fatal(java.lang.Object o,
                  java.lang.Throwable throwable)

fatal

public void fatal(java.lang.Throwable throwable)

getLog

public static Log getLog(java.lang.Class aClass)
Will get an instance of log for a given class.

Parameters:
aClass - to log for
Returns:
the log instance

setLevel

public static void setLevel(java.lang.String level)
Set the logging level (options are TRACE, DEBUG, INFO, WARN, ERROR, FATAL).

Parameters:
level - the level to log with

resetAll

public static void resetAll()
Resets log to default state.


setLogToSystemOut

public static void setLogToSystemOut(boolean logToSystemOut)
If set to true will cause the logger to log to system.out as well as context.log.

Parameters:
logToSystemOut - true or false

setConfiguration

public static void setConfiguration(javax.servlet.FilterConfig filterConfig)
Will setup Log based on the filter config. Uses init paramater "logLevel" to get the log level. Defaults to "INFO".

Parameters:
filterConfig - the filter config to use