org.apache.commons.logging.impl

Class Jdk13LumberjackLogger

public class Jdk13LumberjackLogger extends 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.

Since: 1.1

Field Summary
protected static LeveldummyLevel
This member variable simply ensures that any attempt to initialise this class in a pre-1.4 JVM will result in an ExceptionInInitializerError.
protected Loggerlogger
The underlying Logger implementation we are using.
protected Stringname
Constructor Summary
Jdk13LumberjackLogger(String name)
Construct a named instance of this Logger.
Method Summary
voiddebug(Object message)
Logs a message with java.util.logging.Level.FINE.
voiddebug(Object message, Throwable exception)
Logs a message with java.util.logging.Level.FINE.
voiderror(Object message)
Logs a message with java.util.logging.Level.SEVERE.
voiderror(Object message, Throwable exception)
Logs a message with java.util.logging.Level.SEVERE.
voidfatal(Object message)
Logs a message with java.util.logging.Level.SEVERE.
voidfatal(Object message, Throwable exception)
Logs a message with java.util.logging.Level.SEVERE.
LoggergetLogger()
Return the native Logger instance we are using.
voidinfo(Object message)
Logs a message with java.util.logging.Level.INFO.
voidinfo(Object message, Throwable exception)
Logs a message with java.util.logging.Level.INFO.
booleanisDebugEnabled()
Is debug logging currently enabled?
booleanisErrorEnabled()
Is error logging currently enabled?
booleanisFatalEnabled()
Is fatal logging currently enabled?
booleanisInfoEnabled()
Is info logging currently enabled?
booleanisTraceEnabled()
Is trace logging currently enabled?
booleanisWarnEnabled()
Is warn logging currently enabled?
voidtrace(Object message)
Logs a message with java.util.logging.Level.FINEST.
voidtrace(Object message, Throwable exception)
Logs a message with java.util.logging.Level.FINEST.
voidwarn(Object message)
Logs a message with java.util.logging.Level.WARNING.
voidwarn(Object message, Throwable exception)
Logs a message with java.util.logging.Level.WARNING.

Field Detail

dummyLevel

protected static final Level dummyLevel
This member variable simply ensures that any attempt to initialise this class in a pre-1.4 JVM will result in an ExceptionInInitializerError. It must not be private, as an optimising compiler could detect that it is not used and optimise it away.

logger

protected transient Logger logger
The underlying Logger implementation we are using.

name

protected String name

Constructor Detail

Jdk13LumberjackLogger

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

Parameters: name Name of the logger to be constructed

Method Detail

debug

public void debug(Object message)
Logs a message with java.util.logging.Level.FINE.

Parameters: message to log

See Also: debug

debug

public void debug(Object message, Throwable exception)
Logs a message with java.util.logging.Level.FINE.

Parameters: message to log exception log this cause

See Also: Log

error

public void error(Object message)
Logs a message with java.util.logging.Level.SEVERE.

Parameters: message to log

See Also: error

error

public void error(Object message, Throwable exception)
Logs a message with java.util.logging.Level.SEVERE.

Parameters: message to log exception log this cause

See Also: Log

fatal

public void fatal(Object message)
Logs a message with java.util.logging.Level.SEVERE.

Parameters: message to log

See Also: fatal

fatal

public void fatal(Object message, Throwable exception)
Logs a message with java.util.logging.Level.SEVERE.

Parameters: message to log exception log this cause

See Also: Log

getLogger

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

info

public void info(Object message)
Logs a message with java.util.logging.Level.INFO.

Parameters: message to log

See Also: info

info

public void info(Object message, Throwable exception)
Logs a message with java.util.logging.Level.INFO.

Parameters: message to log exception log this cause

See Also: Log

isDebugEnabled

public boolean isDebugEnabled()
Is debug logging currently enabled?

isErrorEnabled

public boolean isErrorEnabled()
Is error logging currently enabled?

isFatalEnabled

public boolean isFatalEnabled()
Is fatal logging currently enabled?

isInfoEnabled

public boolean isInfoEnabled()
Is info logging currently enabled?

isTraceEnabled

public boolean isTraceEnabled()
Is trace logging currently enabled?

isWarnEnabled

public boolean isWarnEnabled()
Is warn logging currently enabled?

trace

public void trace(Object message)
Logs a message with java.util.logging.Level.FINEST.

Parameters: message to log

See Also: trace

trace

public void trace(Object message, Throwable exception)
Logs a message with java.util.logging.Level.FINEST.

Parameters: message to log exception log this cause

See Also: Log

warn

public void warn(Object message)
Logs a message with java.util.logging.Level.WARNING.

Parameters: message to log

See Also: warn

warn

public void warn(Object message, Throwable exception)
Logs a message with java.util.logging.Level.WARNING.

Parameters: message to log exception log this cause

See Also: Log