Adding Trace Elements
Adding Trace Elements
Tracing is a tool for use primarily during development. You add trace elements so that you can see the behavior of various elements in a production, for the purpose of debugging or diagnosis. To add trace elements to a production, you identify the areas in your code (typically business host classes) where you would like to see runtime information. In those areas, you add lines of code that (potentially) write trace messages. Note that these are messages only in a general sense; trace messages are simply strings and are unrelated to Ens.Message and its subclasses.
Tracing consists of two parts:
-
Writing trace messages in applicable parts of the production (as described here)
-
Enabling tracing as described in Enabling Tracing.
Writing Trace Messages in ObjectScript
To write trace messages in ObjectScript, use the following lines of code:
-
To write a user trace message:
$$$TRACE(trace_message)Where trace_message is a string containing useful information about the context in which you add this line of code.
-
To write a system trace message (less common):
$$$sysTRACE(trace_message)
For example:
$$$TRACE("received application for "_request.CustomerName)
Writing Trace Messages from BPL or DTL
To write trace messages in a BPL business process, use the BPL <trace> element.
To write trace messages in a DTL data transformation, use the DTL <trace> element.