Adobe ColdFusion 8

Controlling debugging information in CFML

The following sections describe how you can use CFML tags and functions to display or hide debugging and tracing information.

Generating debugging information for an individual query

In the Administrator, the cfquery tag debug attribute overrides the Database Activity setting on the Debugging Settings page. The debug attribute has an effect only when debugging output is enabled on the Debugging Settings page, as follows:

  • If Database Activity is selected in the Administrator, specify debug="No" to prevent ColdFusion from displaying the query's SQL and statistics in the debugging output.
  • If Database Activity is not selected in the Administrator, specify debug="Yes" or debug to have ColdFusion display the query's SQL and statistics in the debugging output.

For example, if Database Activity is not selected in the Administrator, you can use the following code to show the query execution time, number of records returned, ColdFusion page, timestamp, and the SQL statement sent to the data source for this query only:

<cfquery name="TestQuery" datasource="cfdocexamples" debug>
    SELECT * FROM TestTable
</cfquery>

The debug attribute can be useful to disable query debugging information generated by queries in custom tags that you call frequently, so that you only see the debugging information for queries in pages that call the tags.

You can also view stored procedure-specific debugging information by specifying the debug attribute in the cfstoredproc tag.