org.apache.commons.logging.impl

Class LogKitLogger

public class LogKitLogger extends Object implements Log, Serializable

Implementation of org.apache.commons.logging.Log that wraps the avalon-logkit logging system. Configuration of LogKit is left to the user.

LogKit accepts only String messages. Therefore, this implementation converts object messages into strings by called their toString() method before logging them.

Field Summary
protected Loggerlogger
Logging goes to this LogKit logger
protected Stringname
Name of this logger
Constructor Summary
LogKitLogger(String name)
Construct LogKitLogger which wraps the LogKit logger with given name.
Method Summary
voiddebug(Object message)
Logs a message with org.apache.log.Priority.DEBUG.
voiddebug(Object message, Throwable t)
Logs a message with org.apache.log.Priority.DEBUG.
voiderror(Object message)
Logs a message with org.apache.log.Priority.ERROR.
voiderror(Object message, Throwable t)
Logs a message with org.apache.log.Priority.ERROR.
voidfatal(Object message)
Logs a message with org.apache.log.Priority.FATAL_ERROR.
voidfatal(Object message, Throwable t)
Logs a message with org.apache.log.Priority.FATAL_ERROR.
LoggergetLogger()

Return the underlying Logger we are using.

voidinfo(Object message)
Logs a message with org.apache.log.Priority.INFO.
voidinfo(Object message, Throwable t)
Logs a message with org.apache.log.Priority.INFO.
booleanisDebugEnabled()
Checks whether the LogKit logger will log messages of priority DEBUG.
booleanisErrorEnabled()
Checks whether the LogKit logger will log messages of priority ERROR.
booleanisFatalEnabled()
Checks whether the LogKit logger will log messages of priority FATAL_ERROR.
booleanisInfoEnabled()
Checks whether the LogKit logger will log messages of priority INFO.
booleanisTraceEnabled()
Checks whether the LogKit logger will log messages of priority DEBUG.
booleanisWarnEnabled()
Checks whether the LogKit logger will log messages of priority WARN.
voidtrace(Object message)
Logs a message with org.apache.log.Priority.DEBUG.
voidtrace(Object message, Throwable t)
Logs a message with org.apache.log.Priority.DEBUG.
voidwarn(Object message)
Logs a message with org.apache.log.Priority.WARN.
voidwarn(Object message, Throwable t)
Logs a message with org.apache.log.Priority.WARN.

Field Detail

logger

protected transient Logger logger
Logging goes to this LogKit logger

name

protected String name
Name of this logger

Constructor Detail

LogKitLogger

public LogKitLogger(String name)
Construct LogKitLogger which wraps the LogKit logger with given name.

Parameters: name log name

Method Detail

debug

public void debug(Object message)
Logs a message with org.apache.log.Priority.DEBUG.

Parameters: message to log

See Also: debug

debug

public void debug(Object message, Throwable t)
Logs a message with org.apache.log.Priority.DEBUG.

Parameters: message to log t log this cause

See Also: Log

error

public void error(Object message)
Logs a message with org.apache.log.Priority.ERROR.

Parameters: message to log

See Also: error

error

public void error(Object message, Throwable t)
Logs a message with org.apache.log.Priority.ERROR.

Parameters: message to log t log this cause

See Also: Log

fatal

public void fatal(Object message)
Logs a message with org.apache.log.Priority.FATAL_ERROR.

Parameters: message to log

See Also: fatal

fatal

public void fatal(Object message, Throwable t)
Logs a message with org.apache.log.Priority.FATAL_ERROR.

Parameters: message to log t log this cause

See Also: Log

getLogger

public Logger getLogger()

Return the underlying Logger we are using.

info

public void info(Object message)
Logs a message with org.apache.log.Priority.INFO.

Parameters: message to log

See Also: info

info

public void info(Object message, Throwable t)
Logs a message with org.apache.log.Priority.INFO.

Parameters: message to log t log this cause

See Also: Log

isDebugEnabled

public boolean isDebugEnabled()
Checks whether the LogKit logger will log messages of priority DEBUG.

isErrorEnabled

public boolean isErrorEnabled()
Checks whether the LogKit logger will log messages of priority ERROR.

isFatalEnabled

public boolean isFatalEnabled()
Checks whether the LogKit logger will log messages of priority FATAL_ERROR.

isInfoEnabled

public boolean isInfoEnabled()
Checks whether the LogKit logger will log messages of priority INFO.

isTraceEnabled

public boolean isTraceEnabled()
Checks whether the LogKit logger will log messages of priority DEBUG.

isWarnEnabled

public boolean isWarnEnabled()
Checks whether the LogKit logger will log messages of priority WARN.

trace

public void trace(Object message)
Logs a message with org.apache.log.Priority.DEBUG.

Parameters: message to log

See Also: trace

trace

public void trace(Object message, Throwable t)
Logs a message with org.apache.log.Priority.DEBUG.

Parameters: message to log t log this cause

See Also: Log

warn

public void warn(Object message)
Logs a message with org.apache.log.Priority.WARN.

Parameters: message to log

See Also: warn

warn

public void warn(Object message, Throwable t)
Logs a message with org.apache.log.Priority.WARN.

Parameters: message to log t log this cause

See Also: Log