Skip to main content

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.

In most cases, you can define two kinds of trace elements: user elements and system elements. In most cases, it is more appropriate to define user trace elements.


For information on writing trace elements in BPL, DTL, or business rules, see Developing BPL Processes, Developing DTL Transformations, and Developing Business Rules.

Also, for information on enabling tracing, see the chapter “Enabling Tracing” in Monitoring Ensemble.

Writing Trace Messages in ObjectScript

To write trace messages in ObjectScript, use the following lines of code:

  • To write a user 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):


    You might see $$$sysTRACE in Ensemble system code, but the appropriate choice for your own business host classes is generally $$$TRACE.

For example:

$$$TRACE("received application for "_request.CustomerName)

Writing Trace Messages in Basic

To write trace messages in Caché Basic, use the following lines of code:

  • To write a user trace message:


    Where CurrentMethod is the name of the current method and arg is the string that you want written to the console.

  • To write a system trace message (less common):


Writing Trace Messages in BPL or DTL

To write user trace messages in a BPL business process or in a DTL data transformation, use the <trace> element. See the Ensemble Business Process Language Reference or the Ensemble Data Transformation Language Reference.

FeedbackOpens in a new tab