org.apache.commons.logging.impl

Class Jdk13LumberjackLogger

Implemented Interfaces:
Log, Serializable

public class Jdk13LumberjackLogger
extends java.lang.Object
implements Log, Serializable

Implementation of the org.apache.commons.logging.Log interface that wraps the standard JDK logging mechanisms that are available in SourceForge's Lumberjack for JDKs prior to 1.4.
Version:
$Revision: 1.6 $ $Date: 2004/06/06 21:13:43 $
Authors:
Scott Sanders
Berin Loritsch
Peter Donald
Vince Eagen

Field Summary

private boolean
classAndMethodFound
protected Logger
logger
The underlying Logger implementation we are using.
protected String
name
private String
sourceClassName
private String
sourceMethodName

Constructor Summary

Jdk13LumberjackLogger(String name)
Construct a named instance of this Logger.

Method Summary

void
debug(Object message)
Log a message with debug log level.
void
debug(Object message, Throwable exception)
Log a message and exception with debug log level.
void
error(Object message)
Log a message with error log level.
void
error(Object message, Throwable exception)
Log a message and exception with error log level.
void
fatal(Object message)
Log a message with fatal log level.
void
fatal(Object message, Throwable exception)
Log a message and exception with fatal log level.
private void
getClassAndMethod()
Gets the class and method by looking at the stack trace for the first entry that is not this class.
Logger
getLogger()
Return the native Logger instance we are using.
void
info(Object message)
Log a message with info log level.
void
info(Object message, Throwable exception)
Log a message and exception with info log level.
boolean
isDebugEnabled()
Is debug logging currently enabled?
boolean
isErrorEnabled()
Is error logging currently enabled?
boolean
isFatalEnabled()
Is fatal logging currently enabled?
boolean
isInfoEnabled()
Is info logging currently enabled?
boolean
isTraceEnabled()
Is trace logging currently enabled?
boolean
isWarnEnabled()
Is warn logging currently enabled?
private void
log(Level level, String msg, Throwable ex)
void
trace(Object message)
Log a message with trace log level.
void
trace(Object message, Throwable exception)
Log a message and exception with trace log level.
void
warn(Object message)
Log a message with warn log level.
void
warn(Object message, Throwable exception)
Log a message and exception with warn log level.

Field Details

classAndMethodFound

private boolean classAndMethodFound

logger

protected Logger logger
The underlying Logger implementation we are using.

name

protected String name

sourceClassName

private String sourceClassName

sourceMethodName

private String sourceMethodName

Constructor Details

Jdk13LumberjackLogger

public Jdk13LumberjackLogger(String name)
Construct a named instance of this Logger.
Parameters:
name - Name of the logger to be constructed

Method Details

debug

public void debug(Object message)
Log a message with debug log level.
Specified by:
debug in interface Log

debug

public void debug(Object message,
                  Throwable exception)
Log a message and exception with debug log level.
Specified by:
debug in interface Log

error

public void error(Object message)
Log a message with error log level.
Specified by:
error in interface Log

error

public void error(Object message,
                  Throwable exception)
Log a message and exception with error log level.
Specified by:
error in interface Log

fatal

public void fatal(Object message)
Log a message with fatal log level.
Specified by:
fatal in interface Log

fatal

public void fatal(Object message,
                  Throwable exception)
Log a message and exception with fatal log level.
Specified by:
fatal in interface Log

getClassAndMethod

private void getClassAndMethod()
Gets the class and method by looking at the stack trace for the first entry that is not this class.

getLogger

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

info

public void info(Object message)
Log a message with info log level.
Specified by:
info in interface Log

info

public void info(Object message,
                 Throwable exception)
Log a message and exception with info log level.
Specified by:
info in interface Log

isDebugEnabled

public boolean isDebugEnabled()
Is debug logging currently enabled?
Specified by:
isDebugEnabled in interface Log

isErrorEnabled

public boolean isErrorEnabled()
Is error logging currently enabled?
Specified by:
isErrorEnabled in interface Log

isFatalEnabled

public boolean isFatalEnabled()
Is fatal logging currently enabled?
Specified by:
isFatalEnabled in interface Log

isInfoEnabled

public boolean isInfoEnabled()
Is info logging currently enabled?
Specified by:
isInfoEnabled in interface Log

isTraceEnabled

public boolean isTraceEnabled()
Is trace logging currently enabled?
Specified by:
isTraceEnabled in interface Log

isWarnEnabled

public boolean isWarnEnabled()
Is warn logging currently enabled?
Specified by:
isWarnEnabled in interface Log

log

private void log(Level level,
                 String msg,
                 Throwable ex)

trace

public void trace(Object message)
Log a message with trace log level.
Specified by:
trace in interface Log

trace

public void trace(Object message,
                  Throwable exception)
Log a message and exception with trace log level.
Specified by:
trace in interface Log

warn

public void warn(Object message)
Log a message with warn log level.
Specified by:
warn in interface Log

warn

public void warn(Object message,
                 Throwable exception)
Log a message and exception with warn log level.
Specified by:
warn in interface Log

Copyright 2002-2004 The Apache Software Foundation.