org.codehaus.dna.impl
Class Log4JLogger

java.lang.Object
  extended byorg.codehaus.dna.impl.Log4JLogger
All Implemented Interfaces:
Logger

public class Log4JLogger
extends java.lang.Object
implements Logger

Logging facade implmentation for Apache Log4J project. The following lists the mapping between DNA log levels and Log4J log levels.

Version:
$Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $

Constructor Summary
Log4JLogger(org.apache.log4j.Logger logger)
          Create an instance of Log4J facade.
 
Method Summary
 void debug(java.lang.String message)
          Log a debug message.
 void debug(java.lang.String message, java.lang.Throwable throwable)
          Log a debug message with an associated throwable.
 void error(java.lang.String message)
          Log a error message.
 void error(java.lang.String message, java.lang.Throwable throwable)
          Log a error message with an associated throwable.
 Logger getChildLogger(java.lang.String name)
          Get the child logger with specified name.
 void info(java.lang.String message)
          Log a info message.
 void info(java.lang.String message, java.lang.Throwable throwable)
          Log a info message with an associated throwable.
 boolean isDebugEnabled()
          Return true if a debug message will be logged.
 boolean isErrorEnabled()
          Return true if a error message will be logged.
 boolean isInfoEnabled()
          Return true if an info message will be logged.
 boolean isTraceEnabled()
          Return true if a trace message will be logged.
 boolean isWarnEnabled()
          Return true if a warn message will be logged.
 void trace(java.lang.String message)
          Log a trace message.
 void trace(java.lang.String message, java.lang.Throwable throwable)
          Log a trace message with an associated throwable.
 void warn(java.lang.String message)
          Log a warn message.
 void warn(java.lang.String message, java.lang.Throwable throwable)
          Log a warn message with an associated throwable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4JLogger

public Log4JLogger(org.apache.log4j.Logger logger)
Create an instance of Log4J facade.

Parameters:
logger - the log4j logger
Method Detail

trace

public void trace(java.lang.String message)
Log a trace message.

Specified by:
trace in interface Logger
Parameters:
message - the message

trace

public void trace(java.lang.String message,
                  java.lang.Throwable throwable)
Log a trace message with an associated throwable.

Specified by:
trace in interface Logger
Parameters:
message - the message
throwable - the throwable

isTraceEnabled

public boolean isTraceEnabled()
Return true if a trace message will be logged.

Specified by:
isTraceEnabled in interface Logger
Returns:
true if message will be logged

debug

public void debug(java.lang.String message)
Log a debug message.

Specified by:
debug in interface Logger
Parameters:
message - the message

debug

public void debug(java.lang.String message,
                  java.lang.Throwable throwable)
Log a debug message with an associated throwable.

Specified by:
debug in interface Logger
Parameters:
message - the message
throwable - the throwable

isDebugEnabled

public boolean isDebugEnabled()
Return true if a debug message will be logged.

Specified by:
isDebugEnabled in interface Logger
Returns:
true if message will be logged

info

public void info(java.lang.String message)
Log a info message.

Specified by:
info in interface Logger
Parameters:
message - the message

info

public void info(java.lang.String message,
                 java.lang.Throwable throwable)
Log a info message with an associated throwable.

Specified by:
info in interface Logger
Parameters:
message - the message
throwable - the throwable

isInfoEnabled

public boolean isInfoEnabled()
Return true if an info message will be logged.

Specified by:
isInfoEnabled in interface Logger
Returns:
true if message will be logged

warn

public void warn(java.lang.String message)
Log a warn message.

Specified by:
warn in interface Logger
Parameters:
message - the message

warn

public void warn(java.lang.String message,
                 java.lang.Throwable throwable)
Log a warn message with an associated throwable.

Specified by:
warn in interface Logger
Parameters:
message - the message
throwable - the throwable

isWarnEnabled

public boolean isWarnEnabled()
Return true if a warn message will be logged.

Specified by:
isWarnEnabled in interface Logger
Returns:
true if message will be logged

error

public void error(java.lang.String message)
Log a error message.

Specified by:
error in interface Logger
Parameters:
message - the message

error

public void error(java.lang.String message,
                  java.lang.Throwable throwable)
Log a error message with an associated throwable.

Specified by:
error in interface Logger
Parameters:
message - the message
throwable - the throwable

isErrorEnabled

public boolean isErrorEnabled()
Return true if a error message will be logged.

Specified by:
isErrorEnabled in interface Logger
Returns:
true if message will be logged

getChildLogger

public Logger getChildLogger(java.lang.String name)
Get the child logger with specified name.

Specified by:
getChildLogger in interface Logger
Parameters:
name - the name of child logger
Returns:
the child logger


Copyright © 2003-2004 Codehaus. All Rights Reserved.