net.sf.asterisk.util.impl
Class Log4JLogger

java.lang.Object
  extended by net.sf.asterisk.util.impl.Log4JLogger
All Implemented Interfaces:
java.io.Serializable, Log

public class Log4JLogger
extends java.lang.Object
implements Log, java.io.Serializable

Implementation of Log that maps directly to a Log4J Logger. Initial configuration of the corresponding Logger instances should be done in the usual manner, as outlined in the Log4J documentation.

Version:
$Id: Log4JLogger.java,v 1.1 2005/04/20 18:22:13 srt Exp $
Author:
Scott Sanders, Rod Waldhoff, Robert Burrell Donkin
See Also:
Serialized Form

Constructor Summary
Log4JLogger()
           
Log4JLogger(java.lang.Class clazz)
          Base constructor.
 
Method Summary
 void debug(java.lang.Object message)
          Log a message to the Log4j Logger with DEBUG priority.
 void debug(java.lang.Object message, java.lang.Throwable t)
          Log an error to the Log4j Logger with DEBUG priority.
 void error(java.lang.Object message)
          Log a message to the Log4j Logger with ERROR priority.
 void error(java.lang.Object message, java.lang.Throwable t)
          Log an error to the Log4j Logger with ERROR priority.
 void fatal(java.lang.Object message)
          Log a message to the Log4j Logger with FATAL priority.
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Log an error to the Log4j Logger with FATAL priority.
 org.apache.log4j.Logger getLogger()
          Return the native Logger instance we are using.
 void info(java.lang.Object message)
          Log a message to the Log4j Logger with INFO priority.
 void info(java.lang.Object message, java.lang.Throwable t)
          Log an error to the Log4j Logger with INFO priority.
 boolean isDebugEnabled()
          Check whether the Log4j Logger used is enabled for DEBUG priority.
 boolean isErrorEnabled()
          Check whether the Log4j Logger used is enabled for ERROR priority.
 boolean isFatalEnabled()
          Check whether the Log4j Logger used is enabled for FATAL priority.
 boolean isInfoEnabled()
          Check whether the Log4j Logger used is enabled for INFO priority.
 boolean isTraceEnabled()
          Check whether the Log4j Logger used is enabled for TRACE priority.
 boolean isWarnEnabled()
          Check whether the Log4j Logger used is enabled for WARN priority.
 void trace(java.lang.Object message)
          Log a message to the Log4j Logger with TRACE priority.
 void trace(java.lang.Object message, java.lang.Throwable t)
          Log an error to the Log4j Logger with TRACE priority.
 void warn(java.lang.Object message)
          Log a message to the Log4j Logger with WARN priority.
 void warn(java.lang.Object message, java.lang.Throwable t)
          Log an error to the Log4j Logger with WARN priority.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4JLogger

public Log4JLogger()

Log4JLogger

public Log4JLogger(java.lang.Class clazz)
Base constructor.

Method Detail

trace

public void trace(java.lang.Object message)
Log a message to the Log4j Logger with TRACE priority. Currently logs to DEBUG level in Log4J.


trace

public void trace(java.lang.Object message,
                  java.lang.Throwable t)
Log an error to the Log4j Logger with TRACE priority. Currently logs to DEBUG level in Log4J.


debug

public void debug(java.lang.Object message)
Log a message to the Log4j Logger with DEBUG priority.

Specified by:
debug in interface Log

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Log an error to the Log4j Logger with DEBUG priority.


info

public void info(java.lang.Object message)
Log a message to the Log4j Logger with INFO priority.

Specified by:
info in interface Log

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Log an error to the Log4j Logger with INFO priority.


warn

public void warn(java.lang.Object message)
Log a message to the Log4j Logger with WARN priority.

Specified by:
warn in interface Log

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Log an error to the Log4j Logger with WARN priority.

Specified by:
warn in interface Log

error

public void error(java.lang.Object message)
Log a message to the Log4j Logger with ERROR priority.

Specified by:
error in interface Log

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Log an error to the Log4j Logger with ERROR priority.

Specified by:
error in interface Log

fatal

public void fatal(java.lang.Object message)
Log a message to the Log4j Logger with FATAL priority.


fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Log an error to the Log4j Logger with FATAL priority.


getLogger

public org.apache.log4j.Logger getLogger()
Return the native Logger instance we are using.


isDebugEnabled

public boolean isDebugEnabled()
Check whether the Log4j Logger used is enabled for DEBUG priority.


isErrorEnabled

public boolean isErrorEnabled()
Check whether the Log4j Logger used is enabled for ERROR priority.


isFatalEnabled

public boolean isFatalEnabled()
Check whether the Log4j Logger used is enabled for FATAL priority.


isInfoEnabled

public boolean isInfoEnabled()
Check whether the Log4j Logger used is enabled for INFO priority.


isTraceEnabled

public boolean isTraceEnabled()
Check whether the Log4j Logger used is enabled for TRACE priority. For Log4J, this returns the value of isDebugEnabled()


isWarnEnabled

public boolean isWarnEnabled()
Check whether the Log4j Logger used is enabled for WARN priority.



Copyright © 2004-2005 Stefan Reuter. All Rights Reserved.