This topic introduces how you can migrate BTT version 5.2 trace to BTT version 7.0 trace.
The original trace API of BTT version 5.2 can be still used in BTT version 7.0. BTT version 7.0 trace facility can automatically map the old API to the new API of BTT version 7.0 trace facility. BTT version 7.0 traces by package, but the original trace is by the Component ID in BTT version 5.2. BTT version 5.2 trace can trace to multiple targets at the same time, but BTT version 7.0 supports tracing to one target at the same time only when the BTTLogFactoryImplementClass is set.
The implementation of trace to File is changed to using Java™ util API, so the original parameter of trace to File is not supported in BTT version 7.0. The original function and implementation of trace to Display is kept in BTT version 7.0, so the parameter for trace to Display is still supported.
BTT 7.0 trace level | BTT 5.2 trace type | WAS trace level | Common logging | Log4J |
---|---|---|---|---|
FATAL | Severe | Fatal | Fatal | Fatal |
ERROR | Error | Severe | Error | Error |
WARN | Warning | Warning | Warn | Warn |
INFO | Information Display | Info | Info | Info |
DEBUG | Debug AllTypes | Detail* | Debug | Debug |
<kColl id="traces"> <field id="initializer" value="com.ibm.btt.base.TraceInitializer" /> <field id="traceToFile" value="yes" /> <field id="traceFileName" value="c:\btt\log\btt.log" /> <field id="traceToDisplay" value="no" /> <field id="traceToWAS" value="yes" /> <field id="traceWindowTitle" value="Server Trace" /> <field id="showOriginator" value="yes" /> <field id="showWarningMessage" value="no" /> <field id="traceLevels" value="debug" /> <field id="traceMaxLogFiles" value="5" /> <field id="font" value="monospaced" /> <field id="createBackup" value="yes" /> <field id="fileNumberOfLines" value="4000" /> <field id="displayNumberOfLines" value="2000" /> <field id="linesOfBuffer" value="7000" /> <field id="lineLength" value="200" /> <kColl id="requestersComponents"> <traceRequester id="#CHA" trace="yes" traceLevels="HML" traceTypes="FATAL" /> <traceRequester id="#CS" trace="yes" traceLevels="HML" traceTypes="DEBUG" /> </kColl> </kColl>
<kColl id="traces"> <field id="initializer" value="com.ibm.btt.base.TraceInitializer" /> <field id="traceTargetFactoryImplClass" value="com.ibm.btt.base.BTTLogFactoryToDisplayImp" /> <field id="displayNumberOfLines" value="2000" /> <kColl id="requestersComponents"> <traceRequester id="com.ibm.btt.base.*" trace="yes" traceLevels="FATAL" /> <traceRequester id="com.ibm.btt.channel.*" trace="yes" traceLevels="DEBUG" /> </kColl> </kColl>
if (Trace.doTrace(Constants.CHACOMPID,Trace.High,Trace.Debug)) Trace.trace(Constants.CHACOMPID,Trace.High,Trace.Debug,Settings.getTID(), " CHA Debug ........."); if (Trace.doTrace(Constants.CHACOMPID,Trace.High,Trace.Information)) Trace.trace(Constants.CHACOMPID,Trace.High,Trace.Information,Settings.getTID(), "CHA info .........");
BTTLog log=BTTLogFactory.getLog(“com.ibm.btt.base.LocalContextImp”); If (log.doDebug()) log.debug(“CHA Debug……”); If (log.doInfo()) log.info(“CHA info……”);
Four trace types
Trace to window and trace to self-defined file functions are kept for migration consideration.
Trace to window function can be used at client side.
<field id="traceMaxLogFiles" value="5"/> <field id="fileNumberOfLines" value="4000"/> <field id="displayNumberOfLines" value="200"/> <field id="linesOfBuffer" value="700"/> <field id="lineLength" value="128"/>
As a result, you can use trace to common logging or trace to WAS instead.
<kColl id="traces"> <field id="traceToFile" value="yes"/> <field id="traceToDisplay" value="yes"/> <field id="traceFileName" value="c:\dse\log\btt.log"/> <field id="traceMaxLogFiles" value="100"/> <field id="font" value="monospaced"/> <field id="createBackup" value="yes"/> <field id="fileNumberOfLines" value="4000"/> <field id="displayNumberOfLines" value="200"/> <field id="linesOfBuffer" value="700"/> <field id="lineLength" value="128"/> <field id="showOriginator" value="yes"/> <field id="useServletsEngineLog" value="no"/> <field id="servletsEngineLogPort" value="80"/> <field id="showWarningMessage" value="yes"/> <field id="traceWindowTitle" value="PSP6 Server Trace"/> <field id="traceTypes" value="DIPEWSV"/> <field id="traceLevels" value="HML"/> <field id="showContextDump" value="yes"/> <kColl id="requestersComponents"> .... </kColl> </kColl>
<kColl id="traces"> <field id="initializer" value="com.ibm.btt.base.TraceInitializer"/> <field id="traceTargetFactoryImplClass" value="com.ibm.btt.base.BTTLogFactoryToCommonLoggingImp" /> <field id="showContextDump" value="yes"/> .... </kColl>
In the XML trace definition migration, <requestersComponents> definition is not used for common logging. You need to configure initializer and traceTargetFactoryImplClass. You can leave the other configuration as it is.
If you choose common logging trace, you need to migrate the TraceConfigServlet class too.
If you choose WAS trace, WAS console has similar functions.
Trace.trace(CommonsConstants.COMPID, Trace.Low, Trace.Information, Settings.getTID(), msg); Trace level=Trace.Low, Setting.getTID() will not use, BTT trace will map the other three parameter to commond-logging.