Package com.ibm.di.log
Interface LogInterface
-
- All Known Implementing Classes:
LogListenerAdapter,TDIJLog,TDILog4j,TDILogJUL
public interface LogInterfaceDefines an Interface to new Loggers. Any Logger we use must adhere to this interface. The Implementation must provide a public constructor with no arguments. After construction either the setCategory() or the addAppender() method will be called.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_INSTANCEstatic java.lang.StringNAMEstatic java.lang.StringTIMEstatic java.lang.StringTYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAppender(LogConfigItem config, java.util.Map<java.lang.String,java.lang.Object> params)Add an Appender to the Logger using the given config.voidclose()Free up all resources this logger uses.voiddebug(java.lang.String str)Log a message with level debug.voiderror(java.lang.String str)Log a message with level error.voiderror(java.lang.String str, java.lang.Throwable error)Log a message with level error, and an additional Throwable.voidfatal(java.lang.String str)Log a message with level fatal.voidfatal(java.lang.String str, java.lang.Throwable error)Log a message with level fatal, and an additional Throwable.voidinfo(java.lang.String str)Log a message with level info.booleanisDebugEnabled()Check if a debug message would be logged.voidlog(java.lang.String level, java.lang.String str)Log a message with the specified level.voidsetCategory(java.lang.String category)Set the category for this Logger.voidwarn(java.lang.String str)Log a message with level warning.
-
-
-
Field Detail
-
TYPE
static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
NAME
static final java.lang.String NAME
- See Also:
- Constant Field Values
-
CONFIG_INSTANCE
static final java.lang.String CONFIG_INSTANCE
- See Also:
- Constant Field Values
-
TIME
static final java.lang.String TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
setCategory
void setCategory(java.lang.String category) throws java.lang.ExceptionSet the category for this Logger. This method specifies a category, to allow a category based configuration.- Parameters:
category- The category to use.- Throws:
java.lang.Exception
-
addAppender
void addAppender(LogConfigItem config, java.util.Map<java.lang.String,java.lang.Object> params) throws java.lang.Exception
Add an Appender to the Logger using the given config. Appender is the log4j name, java.util.logging would call it a Handler. May throw an Exception if the config does not make sense.
The params Map may contain these keys to help set up the Appender:- TYPE: "AssemblyLine" or ""
- NAME: A String with the name of component
- CONFIG_INSTANCE: a RSInterface
- TIME: a String with the time in milliseconds
- Parameters:
config- The LogConfigItem.params- Extra information that may be useful/- Throws:
java.lang.Exception
-
debug
void debug(java.lang.String str)
Log a message with level debug.- Parameters:
str- The string to be logged
-
info
void info(java.lang.String str)
Log a message with level info.- Parameters:
str- The string to be logged
-
warn
void warn(java.lang.String str)
Log a message with level warning.- Parameters:
str- The string to be logged
-
error
void error(java.lang.String str)
Log a message with level error.- Parameters:
str- The string to be logged
-
error
void error(java.lang.String str, java.lang.Throwable error)Log a message with level error, and an additional Throwable.- Parameters:
str- The string to be loggederror- The Throwable to be logged
-
fatal
void fatal(java.lang.String str)
Log a message with level fatal.- Parameters:
str- The string to be logged
-
fatal
void fatal(java.lang.String str, java.lang.Throwable error)Log a message with level fatal, and an additional Throwable.- Parameters:
str- The string to be loggederror- The Throwable to be logged
-
log
void log(java.lang.String level, java.lang.String str)Log a message with the specified level.- Parameters:
level- The level to use when logging.str- The string to be logged
-
isDebugEnabled
boolean isDebugEnabled()
Check if a debug message would be logged.- Returns:
- true if a debug message might be logged
-
close
void close()
Free up all resources this logger uses. The logger will not be called anymore.
-
-