Adobe ColdFusion 8

Calling the cftrace tag

The cftrace tag takes the following attributes. All attributes are optional.

Attribute

Purpose

abort

A Boolean value. If you specify True, ColdFusion stops processing the current request immediately after the tag. This attribute is the equivalent of placing a cfabort tag immediately after the cftrace tag. The default is False. If this attribute is True, the output of the cftrace call appears only in the cftrace.log file. The line in the file includes the text "[ABORTED]".

category

A text string specifying a user-defined trace type category. This attribute lets you identify or process multiple trace lines by categories. For example, you could sort entries in a log according to the category.

The category attribute is designed to identify the general purpose of the trace point. For example, you might identify the point where a custom tag returns processing to the calling page with a "Custom Tag End" category. You can also use finer categories; for example, by identifying the specific custom tag name in the category.

You can include simple ColdFusion variables, but not arrays, structures, or objects, in the category text by enclosing the variable name in number signs (#).

inline

A Boolean value. If you specify True, ColdFusion displays trace output in-line in the page. The default is False.

The inline attribute lets you display the trace results at the place that the cftrace call is processed. This provides a visual cue directly in the ColdFusion page display.

Trace output also appears in a section in the debugging information display.

text

A text message describing this trace point. You can include simple ColdFusion variables, but not arrays, structures, or objects, in the text output by enclosing the variable name in number signs (#).

type

A ColdFusion logging severity type. The inline trace display and dockable.cfm output format show a symbol for each type. The default debugging output shows the type name, which is also used in the log file. The type name must be one of the following:

The Information icon for the logging severity type Information (default)

 

The Warning icon for the logging severity type Warning

 

The Error icon for the logging severity type Error

 

The Fatal Information icon for the logging severity type Fatal Information

var

The name of a single variable that you want displayed. This attribute can specify a simple variable, such as a string, or a complex variable, such as a structure name. Do not surround the variable name in number signs.

Complex variables are displayed in inline output in cfdump format; the debugging display and log file report the number of elements in the complex variable, instead of any values.

You can use this attribute to display an internal variable that the page does not normally show, or an intermediate value of a variable before the page processes it further.

To display a function return value, put the function inside the message. Do not use the function in the var attribute, because the attribute cannot evaluate functions.

Note: If you specify inline trace output, and a cftrace tag is inside a cfsilent tag block, ColdFusion does not display the trace information in line, but does include it in the standard debugging display.

The following cftrace tag displays the information in the example output and log entry in "About the cftrace tag" :

<cftrace abort="False" category="UDF End" inline = "True" text = "GetRecords UDF
    call has completed" var = "MyStatus">