ColdFusion 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.
To display the logging window you must do the following:
To enable ColdFusion to send information to the logging window, do the following:
To 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 call the following JavaScript functions to send information to the logger. In most cases, the function corresponds to a severity level, as follows:
Function |
Severity |
Purpose |
---|---|---|
debug |
A message that aids in debugging problems. |
|
debug |
A representation of a single variable in a format similar to cfdump. This function displays the structure and contents of JavaScript Array and Object variables. |
|
error |
Information about an error. Use this function only in error-handling code. |
|
info |
Information about properly operating code that is useful in tracing and analyzing the client-side code's execution. |
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.
ColdFusion.Log.error("<b>Invalid value:</b><br>" + arg.A, "Pod A"); |
ColdFusion automatically logs messages in the following categories:
Category |
Description |
---|---|
global |
(the default) Messages that are not logged from within the ColdFusion Ajax libraries, for example, initialization of the logging infrastructure. |
http |
Information about HTTP calls and their responses, including the contents of HTTP requests and information on CFC invocations and responses. |
LogReader |
Messages about the log display window. |
bind |
Bind-related actions such as evaluating a bind expression. |
widget |
Control-specific actions such as tree and grid creation.
|
Sign in to your account