ColdFusion 9.0 Resources |
Debugging Ajax applicationsColdFusion provides a set of JavaScript functions that log information to a pop-up display window. ColdFusion also logs many standard client-side activities to the window. Display logging informationTo display the logging window you must do the following:
Enable logging outputTo enable ColdFusion to send information to the logging window, do the following:
Display logging information for a pageTo display the logging window when you request a CFML page in the browser, specify an HTTP parameter of cfdebug in the URL when you request a page, as in the following URL: http://localhost:8500/myStore/products.cfm?cfdebug After the debug log window appears, it continues running until you navigate to a new page in the browser. The logging window includes options that let you filter the messages by either or both of the following criteria:
You can select to display logging information at any combination of four levels of severity: debug, info, error, and window. The specific logging function that you call determines the severity level. The logging window always displays options to filter the output by using standard categories: bind, global, http, LogReader, and widget. (For information on these categories, see Standard ColdFusion logging messages.) It also displays a filter option for each custom category that you specify in a ColdFusion logging call. ColdFusion does not limit the number of categories you create, but create only as many categories as you require to debug your application effectively. Logging informationYou call the following JavaScript functions to send information to the logger. In most cases, the function corresponds to a severity level, as follows:
You cannot generate a window-level message. This level is reserved for messages generated by the log reader window, including information about JavaScript errors in the log function calls. When you call a logging function, you specify a message and a category.
To log information for a page, you must have a ColdFusion Ajax tag on the page, or use the cfajaximport tag. The cfajaximport tag does not require any attributes to enable logging. The following logging function generates an error level, Pod A category log message: ColdFusion.Log.error("<b>Invalid value:</b><br>" + arg.A, "Pod A"); Standard ColdFusion logging messagesColdFusion automatically logs messages in the following categories:
|