Saturday, September 13, 2008

CF: Silent Server Side Debugging

So you get this call. Customer says "Nothing is working"; you cannot replicate. When you go to your application or site everything is working just fine.
Have you been there? I have many a time. Wouldn't it be great to have had the debug output (classic coldfusion format) when the customer ran this?
Well you can. You can change the way coldfusion does the debugging in a fairly straight forward fashion, i.e. you can capture all debug information and save it to files for later analysis by changing the debug handler.
You do this like so:

1.) Download the sample file (
2.) Extract and place the file (ToFile.cfm) in your debug handlers directory [cfusion root]\wwwroot\WEB-INF\debug. If you installed ColdFusion in C:\CfusionMX8 this would be the final directory to place the file in: C:\CfusionMX8\wwwroot\WEB-INF\debug
3.) Log in to ColdFusion Administrator and navigate to Debugging & Logging:Debug Output Settings
4.) Change the " Select Debugging Output Format" drop down to "ToFile.cfm"

For each page that you are generating a debug file, the time needed as well as the file name to which the debug information was saved will be displayed at the bottom of the screen.
You have the option to specify a variable in URL, Form, or Variables scope.
Specify a variable named: "DebugSilent" to suppress the bottom text altogether.

Be careful though how long you keep this on as it will generate many files that need to cleared out.


No comments: