com.ibm.di.log.LogInterface
You can use the example code provided here to work with com.ibm.di.log.LogInterface.
package com.ibm.di.log;
/**
* Defines 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.
*/
public interface LogInterface {
public final static String TYPE = "type";
public final static String NAME = "name";
public final static String CONFIG_INSTANCE = "configInstance";
public final static String TIME = "time";
/**
* Set the category for this Logger.
* This method specifies a category, to allow a category based configuration.
*
* @param category The category to use.
*/
public void setCategory(String category) throws Exception;
/**
* Add an Appender to the Logger using the given config. Appender is the
* org.apache.log4j name, java.util.logging would call it a Handler. May
* throw an Exception if the config does not make sense.<br/>
* The params Map may contain these keys to help set up the Appender:
*
* - TYPE: "AssemblyLine", "EventHandler" or ""
* - NAME: A String with the name of component
* - CONFIG_INSTANCE: a RSInterface
* - TIME: a String with the time in milliseconds
*
*
* @param config
* The LogConfigItem.
* @param params
* Extra information that may be useful/
*/
public void addAppender(LogConfigItem config, Map params) throws Exception;
/**
* Log a message with level debug.
* @param str The string to be logged
*/
public void debug( String str );
/**
* Log a message with level info.
* @param str The string to be logged
*/
public void info( String str );
/**
* Log a message with level warning.
* @param str The string to be logged
*/
public void warn( String str );
/**
* Log a message with level error.
* @param str The string to be logged
*/
public void error( String str );
/**
* Log a message with level error, and an additional Throwable.
* @param str The string to be logged
* @param error The Throwable to be logged
*/
public void error( String str, Throwable error );
/**
* Log a message with level fatal.
* @param str The string to be logged
*/
public void fatal ( String str);
/**
* Log a message with level fatal, and an additional Throwable.
* @param str The string to be logged
* @param error The Throwable to be logged
*/
public void fatal ( String str, Throwable error );
/**
* Log a message with the specified level.
* @param level The level to use when logging.
* @param str The string to be logged
*/
public void log (String level, String str );
/**
* Check if a debug message would be logged.
* @return true if a debug message might be logged
*/
public boolean isDebugEnabled ();
/**
* Free up all resources this logger uses.
* The logger will not be called anymore.
*/
public void close();
}