org.apache.commons.logging.impl

Class Log4JLogger

public class Log4JLogger extends Object implements Log, 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.11 2004/05/19 21:01:23 rdonkin Exp $

Author: Scott Sanders Rod Waldhoff Robert Burrell Donkin

Field Summary
static StringFQCN
The fully qualified name of the Log4JLogger class.
static booleanis12
Loggerlogger
Log to this logger
Stringname
Logger name
Constructor Summary
Log4JLogger()
Log4JLogger(String name)
Base constructor.
Log4JLogger(Logger logger)
For use with a log4j factory.
Method Summary
voiddebug(Object message)
Log a message to the Log4j Logger with DEBUG priority.
voiddebug(Object message, Throwable t)
Log an error to the Log4j Logger with DEBUG priority.
voiderror(Object message)
Log a message to the Log4j Logger with ERROR priority.
voiderror(Object message, Throwable t)
Log an error to the Log4j Logger with ERROR priority.
voidfatal(Object message)
Log a message to the Log4j Logger with FATAL priority.
voidfatal(Object message, Throwable t)
Log an error to the Log4j Logger with FATAL priority.
LoggergetLogger()
Return the native Logger instance we are using.
voidinfo(Object message)
Log a message to the Log4j Logger with INFO priority.
voidinfo(Object message, Throwable t)
Log an error to the Log4j Logger with INFO priority.
booleanisDebugEnabled()
Check whether the Log4j Logger used is enabled for DEBUG priority.
booleanisErrorEnabled()
Check whether the Log4j Logger used is enabled for ERROR priority.
booleanisFatalEnabled()
Check whether the Log4j Logger used is enabled for FATAL priority.
booleanisInfoEnabled()
Check whether the Log4j Logger used is enabled for INFO priority.
booleanisTraceEnabled()
Check whether the Log4j Logger used is enabled for TRACE priority.
booleanisWarnEnabled()
Check whether the Log4j Logger used is enabled for WARN priority.
voidtrace(Object message)
Log a message to the Log4j Logger with TRACE priority.
voidtrace(Object message, Throwable t)
Log an error to the Log4j Logger with TRACE priority.
voidwarn(Object message)
Log a message to the Log4j Logger with WARN priority.
voidwarn(Object message, Throwable t)
Log an error to the Log4j Logger with WARN priority.

Field Detail

FQCN

private static final String FQCN
The fully qualified name of the Log4JLogger class.

is12

private static final boolean is12

logger

private transient Logger logger
Log to this logger

name

private String name
Logger name

Constructor Detail

Log4JLogger

public Log4JLogger()

Log4JLogger

public Log4JLogger(String name)
Base constructor.

Log4JLogger

public Log4JLogger(Logger logger)
For use with a log4j factory.

Method Detail

debug

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

debug

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

error

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

error

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

fatal

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

fatal

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

getLogger

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

info

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

info

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

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.

trace

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

trace

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

warn

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

warn

public void warn(Object message, Throwable t)
Log an error to the Log4j Logger with WARN priority.
Copyright 2002-2004 The Apache Software Foundation.