com.flat502.rox.log.log4j
Class Log4JAdapter

java.lang.Object
  extended by com.flat502.rox.log.log4j.Log4JAdapter
All Implemented Interfaces:
Log

public class Log4JAdapter
extends java.lang.Object
implements Log

A Log4J adapter.

This class implements the Log interface and defers all logging to the Log$J Logger class.

The context parameter on each of the methods on the Log interface is used to retrieve the appropriate Log4J logger in all cases exception logWarn() and logError(). Those methods always return true (Log4J always assumes warnings and errors should be logged).


Constructor Summary
Log4JAdapter(java.lang.String name)
           
 
Method Summary
 void debug(java.lang.String msg)
           
 void debug(java.lang.String msg, java.lang.Throwable e)
           
 void error(java.lang.String msg)
           
 void error(java.lang.String msg, java.lang.Throwable e)
           
 void info(java.lang.String msg)
           
 void info(java.lang.String msg, java.lang.Throwable e)
           
 boolean logDebug()
           
 boolean logError()
           
 boolean logInfo()
           
 boolean logTrace()
           
 boolean logWarn()
           
 void trace(java.lang.String msg)
           
 void trace(java.lang.String msg, java.lang.Throwable e)
           
 void warn(java.lang.String msg)
           
 void warn(java.lang.String msg, java.lang.Throwable e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4JAdapter

public Log4JAdapter(java.lang.String name)
Method Detail

logTrace

public boolean logTrace()
Specified by:
logTrace in interface Log

logDebug

public boolean logDebug()
Specified by:
logDebug in interface Log

logInfo

public boolean logInfo()
Specified by:
logInfo in interface Log

logWarn

public boolean logWarn()
Specified by:
logWarn in interface Log
Returns:
Always returns true

logError

public boolean logError()
Specified by:
logError in interface Log
Returns:
Always returns true

trace

public void trace(java.lang.String msg)
Specified by:
trace in interface Log

trace

public void trace(java.lang.String msg,
                  java.lang.Throwable e)
Specified by:
trace in interface Log

debug

public void debug(java.lang.String msg)
Specified by:
debug in interface Log

debug

public void debug(java.lang.String msg,
                  java.lang.Throwable e)
Specified by:
debug in interface Log

info

public void info(java.lang.String msg)
Specified by:
info in interface Log

info

public void info(java.lang.String msg,
                 java.lang.Throwable e)
Specified by:
info in interface Log

warn

public void warn(java.lang.String msg)
Specified by:
warn in interface Log

warn

public void warn(java.lang.String msg,
                 java.lang.Throwable e)
Specified by:
warn in interface Log

error

public void error(java.lang.String msg)
Specified by:
error in interface Log

error

public void error(java.lang.String msg,
                  java.lang.Throwable e)
Specified by:
error in interface Log