Debugging & Logging section

You use the Debugging Settings and Debugging IPs pages of the Administrator to configure ColdFusion MX to provide debugging information for every application page requested by a browser. You specify debugging preferences using the pages as follows:

This section also includes pages for managing your Log Files, Scheduled Tasks, System Probes, and the Code Compatibility Analyzer.

Debugging Settings page

The Debugging Settings page provides the following debugging options:
Setting
Description
Enable Debugging
Enables the ColdFusion debugging service.
Select Debugging Output Format
Select a format of:
  • classic.cfm - The format available in ColdFusion 5 and earlier. It provides a basic view and few browser restrictions.
  • dockable.cfm - A dockable tree-based debugging panel. For details about the panel and browser restrictions, see the online Help.
Report stack trace to a depth of [n] rows
Reports execution times. The stack trace shows a hierarchical tree of executed templates, includes, modules, and custom tags that were executing at the time of the exception. The default is 5. A blank value or 0 implies no limit.
Database Activity
Shows the database activity for the SQL Query events and Stored Procedure events in the debugging output.
Exception Information
Shows all ColdFusion exceptions raised for the request in the debugging output.
Tracing Information
Shows trace event information in the debugging output. Tracing lets you track program flow and efficiency through the use of the cftrace tag.
Variables
Displays information about parameters, URL parameters, cookies, session, and CGI variables in the debugging output.
Enable Robust Exception Information
Lets visitors view detailed information in the exceptions page, including: the template's physical path and URI, the line number and snippet, the SQL statement used (if any), the Data Source Name (if any), and the Java stack trace.
Enable Performance Monitoring*
Enables the standard NT Performance Monitor application to display information about a running ColdFusion Application Server.
Enable CFSTAT*
Shows performance information on platforms that do not support the NT Performance Monitor.For more information, see "Using the cfstat utility".

* Restart ColdFusion MX after changing this setting.

Using the cfstat utility

The cfstat command-line utility provides real-time performance metrics for ColdFusion. Using a socket connection to obtain metric data, the cfstat utility displays the information that ColdFusion writes to System Monitor without actually using the System Monitor application. The following table lists the metrics that cfstat returns:
Metric abbreviation
Metric name
Description
Pg/Sec
Page hits per second
The number of ColdFusion pages processed per second. You can reduce this by moving static content to HTML pages.
DB/Sec
Database accesses per second
The number of database accesses per second made by ColdFusion. Any difference in complexity and resource load between calls is ignored.
CP/Sec
Cache pops per second
The number of ColdFusion template cache pops per second. A cache pop occurs when ColdFusion ejects a cached template from the template cache to make room for a new template.
Req Q'ed
Number of queued requests
The number of requests that are currently waiting for ColdFusion to process them. Lower values, which you can achieve with efficient CFML, are better.
Req Run'g
Number of running requests
The number of requests that ColdFusion is currently actively processing.
Req TO'ed
Number of timed out requests
The total number of ColdFusion requests that have timed out. Lower values, which you can achieve by aggressive caching, removing unnecessary dynamic operations and third-party events, are better.
AvgQ Time
Average queue time
A running average of the time, in milliseconds, that requests spend waiting for ColdFusion to process them. Lower values , which you can achieve with efficient CFML and enhanced caching, are better.
AvgReq Time
Average request time
A running average of the time, in milliseconds, that ColdFusion spends to process a request (including queued time). Lower values, which you can achieve with efficient CFML, are better.
AvgDB Time
Average database transaction time
A running average of the time ColdFusion spends on database-related processing of ColdFusion requests.
Bytes In/Sec
Bytes incoming per second
The number of bytes ColdFusion read in the last second (not an average).
Bytes Out/Sec
Bytes outgoing per second
The number of bytes ColdFusion wrote in the last second (not an average).

Before you use the cfstat utility, ensure that you selected the Enable Performance Monitoring check box in the ColdFusion Administrator (on the Debugging & Logging > Debugging Settings page). If you select this check box, you must restart ColdFusion for this change to take effect.

Your cfusionmx\bin directory contains the cfstat utility. From that directory, type cfstat and use the following available switches:
Switch
Description/Comment
-n
Suppress column headers (useful for saving output to a file).
-s
Display output in a single line (delay display of the first line so cfstat can display meaningful values in the per-second counters).
#
Where # is an integer, delay display output by # seconds. If you do not specify an integer, cfstat returns one line.
-h
Web server hostname (localhost is the default).
-p
Web server listening port number (80 is the default).

The following figure shows cfstat output in a Windows 2000 environment:

The figure shows the cfstat utility output in Windows.

Debugging IP Addresses page

You use the Debugging IP Addresses page to restrict debugging output to one or more IP addresses. You can add and remove IP addresses.

Note:   If you do not specify IP addresses, and debugging options are active, debugging output displays for all users.

Logging Settings page

You use the Logging Settings page of the Administrator to change ColdFusion MX logging options. The following table describes the settings:
Setting
Description
Log directory*
Directory to which error log files are written.
Maximum file size (kb)
Set the maximum file size for log files. Once a file hits this size, it will be automatically archived.
Maximum number of archives
Set the maximum number of log archives to create. After reaching this limit, files will be deleted in order of oldest to newest.
Use operating system logging facilities
Log messages using your operating system logging facility (EventLog in Windows; syslog on Solaris, Linux, and HP-UX). ColdFusion log messages are also written to the standard ColdFusion MX log files.
Log slow pages taking longer than [n] seconds
Log the names of pages that take longer than the specified interval to process. Logging slow pages can help you diagnose potential problems or bottlenecks in your ColdFusion applications. Entries are written to server.log.
Log all CORBA calls
Log all CORBA calls.
Enable logging for scheduled tasks
Log ColdFusion Executive task scheduling.

* Restart ColdFusion MX after changing this setting.

Log Files page

The Log Files page of the Administrator lets you perform operations on log files, such as searching, viewing, downloading, archiving, and deleting.

Click on a Log File icon, located in the Actions column of the Available Log Files table, to search, view, download, archive, or delete a log file.

For more information, see the online Help.

The following table describes the ColdFusion MX log files:
Log
Description
rdservice.log
Records errors occurring in the ColdFusion Remote Development Services (RDS). This service provides remote HTTP-based access to files and databases.
application.log
Records every ColdFusion MX error reported to a user. Application page errors, including ColdFusion MX syntax, ODBC, and SQL errors are written to the log file.
webserver.log
Records errors that occur in the web server and the ColdFusion MX stub.
exceptions.log
Records stacktraces for exceptions that occur in the server.
scheduler.log
Records scheduled events that have been submitted for execution. Indicates whether task submission was initiated and whether it succeeded. Provides the scheduled page URL, the date and time executed, and a task ID.
server.log
Records errors for ColdFusion MX.
customtag.log
Records errors generated in custom tag processing.
car.log
Records errors associated with Site Archive and Restore operations.
mail.log
Records errors generated by an SMTP mail server.
mailsent.log
Records messages sent by ColdFusion MX.

Scheduled Tasks page

You use the Scheduled Tasks page to schedule the execution of local and remote web pages and to generate static HTML pages. The scheduling facility is useful for applications that do not require user interactions or customized output. ColdFusion developers use this facility to schedule daily sales reports, corporate directories, statistical reports, and so on.

Information that is read more often than written is a good candidate for scheduled tasks. Instead of executing a query to a database every time the page is requested, ColdFusion MX renders the static page with information generated by the scheduled event. Response time is faster because no database transaction takes place.

You can run scheduled tasks once; on a specified date; or at a specified time, daily, weekly, or monthly. You can run a scheduled task daily, at a specified interval, or between specified dates.

The Schedule Task page lets you create, edit, and delete scheduled tasks. For more information, see the online Help.

System Probes page

System probes help you evaluate the status of your ColdFusion applications. Like scheduled tasks, they access a URL at a specified interval, but they can also check for the presence or absence of a string in the URL. If the URL contents are unexpected, or if an error occurred while accessing the URL, the probe can send an e-mail alert to the address specified in the System Probes page. The probe can also execute a script to perform a recovery action, such as restarting the server. All probe actions are logged in logs/probes.log. The System Probes page also displays the status of each probe.

You use the buttons in the Actions column in the System Probes table to perform the following actions:
Action
Description
Edit
Lets you edit the probe.
Run
Runs the probe immediately, even if it was previously disabled.
Enable/Disable
Starts and stops the probe from automatically executing at its specified interval.
Delete
Deletes the probe.

Because probes run as scheduled ColdFusion tasks, they will not run if the ColdFusion MX server on which they are hosted crashes, or if the host web server crashes or otherwise does not respond.

Code Compatibility Analyzer page

The Code Compatibility Analyzer evaluates your ColdFusion pages for potential incompatibilities between ColdFusion MX and ColdFusion Server 5. For more information, see Migrating ColdFusion 5 Applications.

Comments