This article, the second of two parts, explains how to use ColdFusion 6.1 in conjunction with Dreamweaver MX 2004 to build dynamic web sites. It is excerpted from chapter one of the book ColdFusion Web Development with Dreamweaver MX 2004, written by Jen and Peter deHaan et al. (Apress, 2004; ISBN: 1590592379).
Welcome to Coldfusion MX 6.1, concluded - Debugging and Logging (Page 3 of 5 )
ColdFusion MX 6.1 includes a robust debugging environment that allows developers to debug applications easily during development. We cover the debugging options in detail here, including how to set which IP addresses are able to view debugging output, and which variable scopes and debugging output will be displayed.
Debugging Settings
This section is where you decide whether to enable debugging, and in which layout you want to display the debugging information (at the bottom of each template, or in a popup window with an expandable/collapsible tree). By defining what information should be shown in the debug output, developers can get detailed information on variables, queries, execution times, which pages were processed for the current request, and all sorts of valuable error/exception information. You can also define whether to show database query information and which variables and their corresponding values should show up in the debugging output. This debugging output can also be used within Dreamweaver MX 2004 and HomeSite+ in addition to being displayed at the bottom of each template.
Debugging IP Addresses
This is where you enter the IP addresses that will receive the debugging information. It is important to note that if you don’t define IP addresses in this section, all users will receive the debugging output. For this reason, it is advisable to enter at least the IP address of the ColdFusion MX 6.1 Server, or simply the IP address 127.0.0.1, which will always point to the local machine, or in this case the server running ColdFusion MX 6.1.
Logging Settings
When ColdFusion MX 6.1 encounters errors in the code, it will typically log the error to a file, which administrators and developers can peruse later. This helps developers figure out which part of their application is encountering problems and needs attention. In this section, you tell ColdFusion MX 6.1 which directory to save the log files in, the maximum allowed size of the log files before ColdFusion MX 6.1 archives them, and how many archived files to keep before deleting the older error logs. You can also tell ColdFusion MX 6.1 to log any template that takes more than a certain number of seconds to execute. This helps track templates that are performing badly and are perhaps inefficient and/or experiencing problems.
Log Files
This is where you view the log files ColdFusion MX 6.1 has produced. You can also go to the log directory that you defined in the Logging Settings section and open the files in Notepad or any other text editor. Log files can be downloaded, viewed, archived, or deleted.
Scheduled Tasks
ColdFusion MX 6.1 provides developers with an easy way to schedule templates to run at a specific day and time. Using this Web interface, you can create a new task that will execute once or recur every few hours. For example, you could schedule a ColdFusion MX 6.1 template to fetch new data from a remote news-feed every 8 hours, or delete customers’ shopping carts if they haven’t made any changes in the past 24 hours.
System Probes
You can use system probes to check whether your web site is running and functioning properly. Simply create a new probe, enter the URL to check, along with a string or regular expression to check for, and if the probe fails, it can either send an e-mail to a specified address or execute a script or program that could be used to restart the ColdFusion MX 6.1 service.
Code Analyzer
The code analyzer is useful when migrating from an earlier version of ColdFusion MX 6.1. It examines existing code and reports any potential issues that may arise because of deprecated ColdFusion MX 6.1 tags or features.
Extensions
This section is mainly for advanced development. It lets you extend ColdFusion MX 6.1 by registering new Java Applets that you want to use in your applications. You can also define new ColdFusion Extension (CFX) tags (custom tags written in Java or C++) that usually add features beyond those you could build using just CFML. For example, some CFX tags can resize images or convert them to different formats, or just tell you the width and height of an existing image.
Security
In this final section, you can define/disable a password for connecting to the ColdFusion MX 6.1 Administrator or for users to connect to ColdFusion MX 6.1 servers using Dreamweaver MX 2004 or ColdFusion Studio/HomeSite+. The final section, Sandbox Security, is used to restrict which sites can have access to which ColdFusion MX 6.1 elements, functions, and resources. You could prohibit certain sites from using elements such as<cffile>,<cfdirectory>,<cfhttp>,<cfftp>, or<cfmail>. You could even limit which servers or IP addresses the web site can connect to. Sandbox security is primarily used for servers employed in a shared hosting environment, where you want to lock down access to tags and data sources.