Configuring the trace

About this task
The trace configuration in BTT XML file defines the trace target by BTTLogFactory Implementation class, and defines the trace level for packages and classes.

The traceTargetFactoryImplClass field defines the trace target.

Table 1. traceTargetFactoryImplClass
Trace Target value of traceTargetFactoryImplClass Underlying Technical
WAS com.ibm.btt.base.BTTLogFactoryToWASImp Java™.util.logging
File com.ibm.btt.base.BTTLogFactoryToFileOrConsoleImp
Console
Common Logging com.ibm.btt.base.BTTLogFactoryToCommonLoggingImp Common Logging
Log4J
Display window com.ibm.btt.base.BTTLogFactoryToDisplayImp BTT implementation
Note: For more information about Common Logging, see: http://commons.apache.org/logging/guide.html. For more information about Log4J, see http://logging.apache.org/log4j/.
Note:

If you want to trace to file, then you must define the traceFileName_WhenTraceToFile filed, otherwise, the trace output is trace to console.

BTT trace levels are consistent with industry general trace levels: DEBUG, INFO, WARN, ERROR, FATAL. The higher level contains the lower ones. For example, if current level is WARN, then INFO and DEBUG is enabled, while ERROR and FATAL is disabled.

The following table is the trace level map between BTT trace and other trace facility.

Table 2. Trace level map
BTT trace level WAS trace level Common Logging Log4J Original BTT trace level
FATAL Fatal Fatal Fatal Severe
ERROR Severe Error Error Error
WARN Warning Warn Warn Warning
INFO Info Info Info Information Display
DEBUG Detail* Debug Debug Debug AllTypes
Note: If trace to WAS, Console, and File, the entry() and exit() correspond to the FINER level of Java logging.

The trace level configuration for packages or classes can be defined in BTT definition XML file (such as btt.xml). If the trace target is WAS, File or Console, the configuration is registered by Java logging API. BTT trace level configuration is not registered to common logging, so it doesn't affect the trace output of common logging. You can set the configuration of common logging by the way of common logging itself, such as the common-logging.property file.

When tracing to common logging/Log4J, the trace level configuration does not take affect. The trace level should be set by the Log4J configuration itself.

When tracing to WAS, you can also set the level configuration in WAS admin console at runtime. When BTT starts, the trace configuration can register to WAS and override the trace level setting in WAS admin console. But if you tune the level in WAS admin console dynamically after BTT is started, the static BTT trace configuration will be overridden.