Using the cftrace tag to trace execution
403
The following table lists the contents of the trace message and the log entries. For more
information on the log file format, see
Chapter 14, “Logging errors with the cflog tag,”
on page 297
.
Using tracing
As its name indicates, the
cftrace
tag is designed to help you trace the execution of your
application. It can help you do any of several things:
•
You can time the execution of a tag or code section. This capability is particularly useful for
tags and operations that can take substantial processing time. Typical candidates include all
ColdFusion tags that access external resources, including
cfquery
,
cfldap
,
cfftp
,
cffile
,
and so on. To time execution of any tag or code block, call the
cftrace
tag before and after the
code you want to time.
•
You can display the values of internal variables, including data structures. For example, you can
display the raw results of a database query.
•
You can display an intermediate value of a variable. For example, you could use this tag to
display the contents of a raw string value before you use string functions to select a substring or
format it.
•
You can display and log processing progress. For example, you can put a
cftrace
call at the
head of pages in your application or before critical tags or calls to critical functions. (Doing this
could result in massive log files in a complex application, so you should use this technique with
care.)
Entry
Meaning
Information
The Severity specified in the
cftrace
call.
web-29
Server thread that executed the code.
04/01/02
Date the trace was logged.
13:21:11
Time the trace was logged.
MyApp
The application name, as specified in a
cfapplication
tag.
501 ms (1st trace)]
The time ColdFusion took to process the current request up to the
cftrace
tag, This is the first
cftrace
tag processed in this request. If
there had been a previous
cftrace
tag, the parentheses would contain
the number of milliseconds between when the previous
cftrace
tag ran
and when this tag ran.
[C:\CFusionMX\wwwroot\
MYStuff\NeoDocs\
tractest.cfm @ line: 14]
Path of the page on which the trace tag is located and the line number of
the
cftrace
tag on the page.
[UDF End]
Value of the
cftrace
tag
category
attribute.
[MyStatus = Success]
Name and value of the variable specified by the
cftrace
tag
var
attribute. If the variable is a complex data type, such as an array or
structure, the log contains the variable value and the number of entries at
the top level of the variable, such as the number of top-level structure
keys.
GetRecords UDF call has
completed
The
cftrace
tag
text
attribute with any variables replaced with their
values.
Содержание COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...