A few people have reported that they are unable to see debugging in the ColdFire Firebug panel. I've been unable to reproduce these issues so I thought I put together a quick post on how ColdFire works in hopes that it may help people debug their issues.
ColdFire works using custom HTTP request and response headers. You can inspect these custom headers using the Net tab of the Firebug extension.
ColdFire debugging really begins with the request. If Firebug is enabled for the site then the ColdFire appends "ColdFire/xxx" to the User-Agent request header before the request is sent to the server.
The coldfire.cfm template then checks the User-Agent request header to ensure it has the appropriate "ColdFire/xxx" string before doing any processing. If you take a look at the coldfire.cfm you will see that the User-Agent header is not the only condition that must be met in order for ColdFire to process.
and FindNoCase("ColdFire/1.001",GetHttpRequestData().headers["User-Agent"]) gt 0
and not GetPageContext().GetResponse().containsHeader("location")>
<!--- Build Headers --->
First we check to see that debugging has been enabled in the ColdFusion administrator via the IsDebugMode function. Then we check to see if we have a User-Agent header and if so, that it is set to the correct ColdFire version.
Finally we check to see that <cflocation> has not been used in this request. If all those conditions are met ColdFire then goes about adding custom headers to the response.
The coldfire.cfm passes debugging info back to the ColdFire extension via several custom headers:
With the exception of x-coldfire-general the headers may have 1 to n headers based on how much data we are sending back to the user. For example, if you have a lot of queries on a page you may have several x-coldfire-queries headers, each numbered sequentially like so: x-coldfire-queries-1, x-coldfire-queries-2, x-coldfire-queries-3, etc. The ColdFire extension then parses the JSON encoded data in these headers and displays it in the ColdFusion Firebug panel.
Things To Check If You Are Having Issues With ColdFire
If you are not seeing debugging info in the Firebug ColdFusion panel I would first check to see if debugging works using the classic.cfm debugging template.
If it does I would next check the following:
- Check that Firebug is enabled for the site you are trying to debug.
Under Debug Output Settings in the ColdFusion administrator:
- Ensure Enable Request Debugging Output is checked
- Ensure coldfire.cfm is selected for Debugging Output Format
- Ensure Report Execution Times is checked
- Ensure General Debug Information is checked
- Ensure Database Activity is checked
- Ensure Exception Information is checked
- Ensure Tracing Information is checked
- Ensure Timer Information is checked
- Check that your IP address is listed under under Debugging IP Addresses in the ColdFusion administrator.
- Check that you are not using <cflocation> or <cfflush> on the page you are trying to debug.
Check that you are not using <cfsetting showdebugoutput="false"> on
the page you are trying to debug.
- Check that User-Agent header is being set. You can do this using the Net tab in Firebug.
- Check that x-coldfire headers are being returned, again using the Firebug Net tab.
Update: ColdFire also requires that Firebug's Net panel be enabled.
Depending on what headers are set you can determine where the issue is. If the User-Agent header is not being set then the issue has something to do with Firebug or the ColdFire extension. If the User-Agent reqeust header is set but there are not x-coldfire response headers then the issue has something to do with ColdFusion or the coldfire.cfm template. Finally if you see x-coldfire response headers in Firebug's Net panel but nothing in the ColdFusion panel, then something has gone wrong with the ColdFire extension.
If you think the issue is with the coldfire.cfm you can use standard ColdFusion debugging techniques such as placing strategic <cfabort> calls to determine what is causing the problem. If the problem is thought to be with the ColdFire extension you may try looking at Firefox's Error Console to see if any errors are being thrown. (Note that in the current version there are several messages logged to the console by the ColdFire Service. These are not errors and this debugging output will be removed in the next release.)
I hope this post helps those of you having issues with ColdFire figure out what is going on. ColdFire is still a work in progress so keep the bug reports and feature requests coming!