|
ColdFusion Home
Basic ColdFusionIntroductionColdFusion Installation ColdFusion Editors ColdFusion Syntax ColdFusion Includes ColdFusion Variables ColdFusion Variable Types ColdFusion If Statements ColdFusion Loops ColdFusion Datasource ColdFusion Database Queries ColdFusion Lists ColdFusion Arrays ColdFusion Redirect ColdFusion Debugging ColdFusion Error Handling Advanced ColdFusionColdFusion MailColdFusion Functions ColdFusion Components ColdFusion Web Services ColdFusion Upload File ColdFusion Read File ColdFusion Write File ColdFusion Append File ColdFusion Rename File ColdFusion Copy File ColdFusion Move File ColdFusion Delete File Cffile Parameters Using cffile Parameters ColdFusion FTP (cfftp) cfftp Cached Connections ColdFusion HTTP (cfhttp) ColdFusion Query of Queries ColdFusion Charts ColdFusion Summary ColdFusion AdminCF AdministratorCF Archive and Deploy CF Scheduled Tasks CF Mini Tutorial ColdFusion BooksColdFusion MX BibleMacromedia ColdFusion MX 7 Web Application Construction Kit Got a MySpace Page?Get "www.yourname.com" for your MySpace page. Learn how >>. |
ColdFusion DebuggingColdFusion provides a number of debugging tools to assist us in troubleshooting problem areas. Problem areas could be anything from strange results being output from a query, to a slow running template. ColdFusion's debugging tools, provides us with extra information that we (and our users) don't normally see when visiting the website. When running a debugger, you should attempt to do so in a development environment. Obviously, this makes sense if you're only in development mode anyway, but, if you're debugging an issue that's occuring in a production environment (where real users are impacted), you should really try recreating the issue on your development environment. Having said that, there are ways of restricting debug output so that your users aren't affected. The following ColdFusion tools/tags can be useful for debugging your applications:
Below is an overview of each. The cfdump TagThe cfdump tag is a very handy debugging tool for ColdFusion developers. It allows you to output (or "dump") the contents of your variables on the screen. You can use this on any variable, regardless of it's type - arrays, structures, query objects etc The great thing about cfdump is it's ease of use. The syntax is as follows:
Example of UsageIt's just as easy to use cfdump on a complex object as it is on a simple variable. Therefore, to give you a better idea of how cfdump can help you visualize your objects, I will use a query object for this example. First, lets create a query object. We do this with the cfquery tag:
A cfdump of the above query would like something like this:
The cfabort TagIt can sometimes be handy placing a cfabort tag immediately after your cfdump. This way, you prevent the application from doing any further processing until you've decided whether the results of the cfdump are correct or not. If you decide the results of the cfdump are correct, you can continue to step through the page, placing cfabort (and/or cfdump) at logical points so that you can get a "snapshot" of the state that the application is in at a particular point. Debugging Settings (via ColdFusion Administrator)The ColdFusion Administrator provides a number of debugging options for developers. You can find these options under the DEBUGGING & LOGGING heading on the left menu. The first option is Debugging Settings. This allows you to specify what debug info should be displayed and how. The next option on the left menu lets you restrict the debug output to specific IP addresses if required. This is useful if you are debugging in a production environment and don't want your users to see the debugging output. Below are the options available in the Debugging Settings option:
The following options can be enabled/disabled independently of the above debugging settings:
Enjoy this website?
Oh, and thank you for supporting Quackit! |
Featured Template:
(Build your websites in minutes!) |
|||||||||||||||||||||||||||||||||||