Trace by component

By using trace by component, you can decide whether to enable trace for a specific component. BTT trace supports self-defined component ID.

The setting in btt.xml is as follows:
<traceRequester id="#CHA" trace="yes" traceLevel="INFO"/>
<traceRequester id="#BTT_APPL" trace="yes" traceLevel="DEBUG"/>

BTT trace also supports trace by sub-component. The naming rule for sub-component is to separate the name of the main component and the name of the sub-component with a . sign.

In the following example, one main component Invoker and two sub components are defined:
<traceRequester id="#Invoker" trace="yes" traceLevel="INFO"/>
<traceRequester id="#Invoker.WebService" trace="no" traceLevel="DEBUG"/>
<traceRequester id="#Invoker.EJB" trace="yes" traceLevel="ERROR"/>

The trace setting of the sub-component can override that of the main component. When the trace setting of sub component is not defined in btt.xml, BTT trace will use the setting of the main component automatically.

Note: The trace by sub-component is not supported if you use the trace APIs of the previous versions of BTT.
Following are the simplified BTT trace APIs:
BTTLog  log=BTTLogFactory.getLog(Constants.CHACOMPID); 
if (log.doError())
	   log.error(errMsg);
if (Trace.doInfo())
	   Trace.info(“CHA information .....");
These APIs are simpler than the trace APIs of the previous versions, which are shown in the following example:
if (Trace.doTrace(Constants.CHACOMPID,Trace.High,Trace.Error))
Trace.trace(Constants.CHACOMPID,Trace.High,Trace.Error,Settings.getTID(),errMsg);

Basic BTT exception classes are provided for other BTT components to handle the exceptions. Besides the DSEException, BTT also provides another basic exception DSERuntimeException, which is extended from jDSERuntimeException. For DSERuntimeException, the exception can be thrown and handled by JVM automatically.