TDI uses a logging class to record messages to a number of various log channels. All TDI components use this logging class which in turn invokes an industry standard logging tool (Log4J). While Log4J provides a variety of output channels and formats, there are other logging utilities with overlapping and additional output channels that you as a TDI user may need. Many of these are open source libraries that are not bundled with TDI for legal reasons. To enable inclusion of these 3rd party logging utilities, the TDI logging component is modeled to act as a proxy between TDI and the actual logging implementations, called LogInterface implementations. Refer to the section "Creating additional Loggers" in IBM TDI V7.1 Reference Guide for more information on how to create, configure and program our own LogInterface classes.
Enable or disable logging in TDI by configuring the com.ibm.di.logging.enabled property. To enable logging, use com.ibm.di.logging.enabled=true (default). To completely disable logging, use com.ibm.di.logging.enabled=false.
The remainder of this section describes how to use the logging class that is bundled with TDI, called com.ibm.di.log.TDILog4J.
Logging and debugging by the system is mainly done through the Task object (the current AssemblyLine). Logging can either be done explicitly (in script) or done by the various components themselves.
The Log4J logging engine is a very flexible framework that lets you log to file, eventlog, syslog and more, and can be tuned so it suits most needs. It can be a great help when we want to troubleshoot or debug the solution. By means of the aforementioned logging class, TDI has additional tracing facilities (discussed in Tracing and FFDC), though in most cases, the logging functionality described here suffice.
Some TDI components may have very specific troubleshooting guidelines; always check the particular component's section in the IBM TDI V7.1 Reference Guide and the IBM TDI V7.1 Problem Determination Guide for more information.
The log scheme for the server (ibmdisrv) is described by the file Log4J.properties and elements of the Config file, see Log4J default parameters.
Any of the aforementioned properties files can be located in the Solution Directory, in which case the properties listed in these files override the values in the file in the installation directory.
We can create our own appenders to be used by the Log4J logging engine by defining them in the Log4J.properties file. We can use drivers built-in to Log4J like the default one, which is defined with the statement:
Log4J.appender.Default=org.apache.Log4J.FileAppender
The phrase org.apache.Log4J.FileAppender defines this appender to use the FileAppender class. Additional Log4J compliant drivers are available on the Internet, for example drivers that can log using JMS or JDBC. In order to use those, they need to be installed into the IBM TDI installation jars directory after which appenders can be defined using those additional drivers in Log4J.properties. For more information, refer to http://jakarta.apache.org/log4j/docs.
In addition to the IBM TDI built-in logging, we can log by adding script code in your AssemblyLine. This is described in much more detail in the IBM TDI V7.1 Users Guide, in which you also find out how the interactive debugger works.