Package com.ibm.di.log
Class TDIJLog
- java.lang.Object
-
- com.ibm.di.log.TDIJLog
-
- All Implemented Interfaces:
LogInterface
public class TDIJLog extends java.lang.Object implements LogInterface
Implements LogInterface for com.ibm.log.Logger
-
-
Field Summary
-
Fields inherited from interface com.ibm.di.log.LogInterface
CONFIG_INSTANCE, NAME, TIME, TYPE
-
-
Constructor Summary
Constructors Constructor Description TDIJLog()
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAppender(LogConfigItem config, java.util.Map<java.lang.String,java.lang.Object> map)
This sample code only understand the FileHandler.void
close()
Free up all resources this logger uses.void
debug(java.lang.String str)
Log a message with level debug.void
error(java.lang.String str)
Log a message with level error.void
error(java.lang.String str, java.lang.Throwable error)
Log a message with level error, and an additional Throwable.void
fatal(java.lang.String str)
Log a message with level fatal.void
fatal(java.lang.String str, java.lang.Throwable error)
Log a message with level fatal, and an additional Throwable.void
info(java.lang.String str)
Log a message with level info.boolean
isDebugEnabled()
Check if a debug message would be logged.void
log(java.lang.String level, java.lang.String str)
Log a message with the specified level.void
setCategory(java.lang.String category)
Set the category.void
warn(java.lang.String str)
Log a message with level warning.
-
-
-
Method Detail
-
setCategory
public void setCategory(java.lang.String category)
Set the category.- Specified by:
setCategory
in interfaceLogInterface
- Parameters:
category
- The category
-
addAppender
public void addAppender(LogConfigItem config, java.util.Map<java.lang.String,java.lang.Object> map) throws java.lang.Exception
This sample code only understand the FileHandler. More code could be added for other Handlers- Specified by:
addAppender
in interfaceLogInterface
- Parameters:
config
- The LogConfigItem.map
- Extra information that may be useful/- Throws:
java.lang.Exception
-
debug
public void debug(java.lang.String str)
Log a message with level debug.- Specified by:
debug
in interfaceLogInterface
- Parameters:
str
- The string to be logged
-
info
public void info(java.lang.String str)
Log a message with level info.- Specified by:
info
in interfaceLogInterface
- Parameters:
str
- The string to be logged
-
warn
public void warn(java.lang.String str)
Log a message with level warning.- Specified by:
warn
in interfaceLogInterface
- Parameters:
str
- The string to be logged
-
error
public void error(java.lang.String str)
Log a message with level error.- Specified by:
error
in interfaceLogInterface
- Parameters:
str
- The string to be logged
-
error
public void error(java.lang.String str, java.lang.Throwable error)
Log a message with level error, and an additional Throwable.- Specified by:
error
in interfaceLogInterface
- Parameters:
str
- The string to be loggederror
- The Throwable to be logged
-
fatal
public void fatal(java.lang.String str)
Log a message with level fatal.- Specified by:
fatal
in interfaceLogInterface
- Parameters:
str
- The string to be logged
-
fatal
public void fatal(java.lang.String str, java.lang.Throwable error)
Log a message with level fatal, and an additional Throwable.- Specified by:
fatal
in interfaceLogInterface
- Parameters:
str
- The string to be loggederror
- The Throwable to be logged
-
log
public void log(java.lang.String level, java.lang.String str)
Log a message with the specified level.- Specified by:
log
in interfaceLogInterface
- Parameters:
level
- The level to use when logging.str
- The string to be logged
-
isDebugEnabled
public boolean isDebugEnabled()
Check if a debug message would be logged.- Specified by:
isDebugEnabled
in interfaceLogInterface
- Returns:
- true if a debug message might be logged
-
close
public void close()
Free up all resources this logger uses. The logger will not be called anymore.- Specified by:
close
in interfaceLogInterface
-
-