Package org.apache.commons.logging.impl
Class LogKitLogger
- java.lang.Object
-
- org.apache.commons.logging.impl.LogKitLogger
-
- All Implemented Interfaces:
java.io.Serializable,Log
public class LogKitLogger extends java.lang.Object implements Log, java.io.Serializable
Implementation oforg.apache.commons.logging.Logthat wraps the avalon-logkit logging system. Configuration ofLogKitis left to the user.LogKitaccepts onlyStringmessages. Therefore, this implementation converts object messages into strings by called theirtoString()method before logging them.- Version:
- $Id: LogKitLogger.java 1448119 2013-02-20 12:28:04Z tn $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.log.LoggerloggerLogging goes to thisLogKitloggerprotected java.lang.StringnameName of this loggerprivate static longserialVersionUIDSerializable version identifier.
-
Constructor Summary
Constructors Constructor Description LogKitLogger(java.lang.String name)ConstructLogKitLoggerwhich wraps theLogKitlogger with given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.Object message)Logs a message withorg.apache.log.Priority.DEBUG.voiddebug(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.DEBUG.voiderror(java.lang.Object message)Logs a message withorg.apache.log.Priority.ERROR.voiderror(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.ERROR.voidfatal(java.lang.Object message)Logs a message withorg.apache.log.Priority.FATAL_ERROR.voidfatal(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.FATAL_ERROR.org.apache.log.LoggergetLogger()Return the underlying Logger we are using.voidinfo(java.lang.Object message)Logs a message withorg.apache.log.Priority.INFO.voidinfo(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.INFO.booleanisDebugEnabled()Checks whether theLogKitlogger will log messages of priorityDEBUG.booleanisErrorEnabled()Checks whether theLogKitlogger will log messages of priorityERROR.booleanisFatalEnabled()Checks whether theLogKitlogger will log messages of priorityFATAL_ERROR.booleanisInfoEnabled()Checks whether theLogKitlogger will log messages of priorityINFO.booleanisTraceEnabled()Checks whether theLogKitlogger will log messages of priorityDEBUG.booleanisWarnEnabled()Checks whether theLogKitlogger will log messages of priorityWARN.voidtrace(java.lang.Object message)Logs a message withorg.apache.log.Priority.DEBUG.voidtrace(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.DEBUG.voidwarn(java.lang.Object message)Logs a message withorg.apache.log.Priority.WARN.voidwarn(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.WARN.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serializable version identifier.- See Also:
- Constant Field Values
-
logger
protected transient volatile org.apache.log.Logger logger
Logging goes to thisLogKitlogger
-
name
protected java.lang.String name
Name of this logger
-
-
Method Detail
-
getLogger
public org.apache.log.Logger getLogger()
Return the underlying Logger we are using.
-
trace
public void trace(java.lang.Object message)
Logs a message withorg.apache.log.Priority.DEBUG.- Specified by:
tracein interfaceLog- Parameters:
message- to log- See Also:
Log.trace(Object)
-
trace
public void trace(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.DEBUG.- Specified by:
tracein interfaceLog- Parameters:
message- to logt- log this cause- See Also:
Log.trace(Object, Throwable)
-
debug
public void debug(java.lang.Object message)
Logs a message withorg.apache.log.Priority.DEBUG.- Specified by:
debugin interfaceLog- Parameters:
message- to log- See Also:
Log.debug(Object)
-
debug
public void debug(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.DEBUG.- Specified by:
debugin interfaceLog- Parameters:
message- to logt- log this cause- See Also:
Log.debug(Object, Throwable)
-
info
public void info(java.lang.Object message)
Logs a message withorg.apache.log.Priority.INFO.- Specified by:
infoin interfaceLog- Parameters:
message- to log- See Also:
Log.info(Object)
-
info
public void info(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.INFO.- Specified by:
infoin interfaceLog- Parameters:
message- to logt- log this cause- See Also:
Log.info(Object, Throwable)
-
warn
public void warn(java.lang.Object message)
Logs a message withorg.apache.log.Priority.WARN.- Specified by:
warnin interfaceLog- Parameters:
message- to log- See Also:
Log.warn(Object)
-
warn
public void warn(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.WARN.- Specified by:
warnin interfaceLog- Parameters:
message- to logt- log this cause- See Also:
Log.warn(Object, Throwable)
-
error
public void error(java.lang.Object message)
Logs a message withorg.apache.log.Priority.ERROR.- Specified by:
errorin interfaceLog- Parameters:
message- to log- See Also:
Log.error(Object)
-
error
public void error(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.ERROR.- Specified by:
errorin interfaceLog- Parameters:
message- to logt- log this cause- See Also:
Log.error(Object, Throwable)
-
fatal
public void fatal(java.lang.Object message)
Logs a message withorg.apache.log.Priority.FATAL_ERROR.- Specified by:
fatalin interfaceLog- Parameters:
message- to log- See Also:
Log.fatal(Object)
-
fatal
public void fatal(java.lang.Object message, java.lang.Throwable t)Logs a message withorg.apache.log.Priority.FATAL_ERROR.- Specified by:
fatalin interfaceLog- Parameters:
message- to logt- log this cause- See Also:
Log.fatal(Object, Throwable)
-
isDebugEnabled
public boolean isDebugEnabled()
Checks whether theLogKitlogger will log messages of priorityDEBUG.- Specified by:
isDebugEnabledin interfaceLog- Returns:
- true if debug is enabled in the underlying logger.
-
isErrorEnabled
public boolean isErrorEnabled()
Checks whether theLogKitlogger will log messages of priorityERROR.- Specified by:
isErrorEnabledin interfaceLog- Returns:
- true if error is enabled in the underlying logger.
-
isFatalEnabled
public boolean isFatalEnabled()
Checks whether theLogKitlogger will log messages of priorityFATAL_ERROR.- Specified by:
isFatalEnabledin interfaceLog- Returns:
- true if fatal is enabled in the underlying logger.
-
isInfoEnabled
public boolean isInfoEnabled()
Checks whether theLogKitlogger will log messages of priorityINFO.- Specified by:
isInfoEnabledin interfaceLog- Returns:
- true if info is enabled in the underlying logger.
-
isTraceEnabled
public boolean isTraceEnabled()
Checks whether theLogKitlogger will log messages of priorityDEBUG.- Specified by:
isTraceEnabledin interfaceLog- Returns:
- true if trace is enabled in the underlying logger.
-
isWarnEnabled
public boolean isWarnEnabled()
Checks whether theLogKitlogger will log messages of priorityWARN.- Specified by:
isWarnEnabledin interfaceLog- Returns:
- true if warn is enabled in the underlying logger.
-
-