Windows 2008: Page 3

[frs-237] Creating Daily FusionReactor Log Files

Creating Daily Log Files in FusionReactor

FusionReactor captures a lot of very useful data into log files. These log files can be used to analyze a server in great detail. FusionReactor's logging mechanmism allows you to decide how many log files you want to keep and how big each log file should be but it doesn't allow you to rotate the log files every day.

It would be great to rotate the log files every day so that we can keep a record for as long as we want instead of losing data when the log files rotate automatically.

Using FRAPI (FusionReactor's API) this is easy to achieve.


FusionReactor 3.0.1+

The Article

FusionReactor captures data about Requests, JDBC Requests, Resources, CrashProtection actions and details about itself into log files. These log files are typically placed under a log folder that can for each instance of FusionReactor. On a Windows installation the log folder might by for example:



FRAPI is a powerful and easy to use API that allows you to take control of FusionReactor programatically. Using FRAPI you can change the running configuration of FusionReactor.

Here's how to instantiate the FRAPI interface in CFML. Once we have FRAPI available we are able to read this FusionReactor's configuration:

            <cfset frapi = createObject("java", "com.intergral.fusionreactor.api.FRAPI").getInstance()>
            <cfset config = frapi.getRunningConfiguration()>
            <cfdump var="#config#">
                <!--- FRAPI isn't available so FusionReactor probably isn't installed --->

Note that we always wrap FRAPI calls in a TRY/CATCH block. The reason for this is that FusionReactor may not be installed on every computer that you run the code on. The TRY/CATCH blocks will make sure that FRAPI calls will have no influence on your code even if FusionReactor isn't installed.

To try FRAPI, create a "frapiconfig.cfm" file with the CFML code above and run the page on a system that has FusionReactor installed. After the page has completed you should see a dump of FusionReactors configuration for this instance.

Once we have the configuration, we can change it and tell FusionReactor to update very easily like this:

            <cfset config.setValue("logfile", "#install_location#/instance/#instance_name#/log/#datetime#/reactor.log")>
            <cfset frapi.setRunningConfiguration(config)>


            <cfset frapi = createObject("java", "com.intergral.fusionreactor.api.FRAPI").getInstance()>
            <cfsavecontent variable="debugData"><cfinclude template="classic.cfm"></cfsavecontent>
            <cfset frapi.trace( debugData )>
                <!--- FRAPI isn't available so FusionReactor probably isn't installed --->


  1. Log File Sizes
    Some of FusionReactor's log files can fill very quickly. This is especially true of the JDBC log files. You need to take this into consideration when you set the log file size(s). As a counter point you have to be aware that using very large log files sizes and rotating the log files every day can very quickly use up lots of disk space. Please take care when setting the log file sizes and consider archiving or removing log files based upon there age.
  1. Log File Count
    FusionReactor lets you set the number of log files you want to keep for each log type. It's tempting to set this to a large number so that FusionReactor doesn't lose any information but you should consider that the more log files FusionReactor has to manage and rotate, the slower the log file rotate will be. I would not advise you to set the log file count higher than 20 log files. It is more advisable to balance the number of log files and the log file size. For example, of you set the log file count to 10 and the log file size to 20480 (log file size is set in KBytes) then you would create a maximum of 200MBytes of log data (for the specific log).

Fast Track

  1. Copy the frapi.rotatelogdirectoy.cfm file linked to this article to a folder where you run ColdFusion (for example): <coldfusion folder>/wwwroot/fusionreactor
  2. Create a scheduled task to run this page once per day at 00:00:00 midnight


By rotating FusionReactor's log files daily you can keep log files for as long as you want and can prevent you from losing this valuable data when FusionReactor rotates it's log files automatically when the size of the file has been reached.

Issue Details

Type: DevNet
Issue Number: FRS-237
Components: Logging
Resolution: Fixed
Last Updated: 06/Nov/09 6:51 PM
Affects Version: 2.0, 2.0.3, 2.0.4, 3.0, 3.0.1, 3.5
Fixed Version: 3.0.1, 3.5
Platform: Windows XP, Windows 2000, Windows 2003, Linux, MacOS, Solaris, Windows Vista, Windows x64, AIX, Windows 7, Windows 2008
Related Issues:

FRS-232: Capturing ColdFusion’s Debug Output in FusionReactor

[frs-231] The Hostname in Request URL’s show “null” instead of the server name or IP address in ColdFusion 9

Due to an issue in the JRun version used with ColdFusion 9, the Hostname in Request URL's can sometimes contain the string "null" instead of the actual hostname.

Finished: 18:48:30.774 28-Sep-2009  200  11841  web-0  http://null:8500/test/test.cfm  0  Cur:(13%)67,809 Free:437,086

The problem occurs when a request is made against a port that is not the default port (e.g. 80) and the port number is not included in the HTTP Host header sent to the ColdFusion server by the web client. For example:

Some web clients incorrectly do not include the port number in the Host: header that is sent for the request. For example:

GET /test/test.jdbcfast.cfm HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Connection: Close

This problem has been confirmed for Microsoft Web Application Stress (which does not send the port number in the Host header), but other clients may suffer from the same bug.


To work around the issue you should use the default web port (e.g. 80), or use a different client that correctly sends the port number in the Host: header of HTTP requests.

A bug report has been submitted to Adobe for this issue.

Issue Details

Type: Technote
Issue Number: FRS-231
Components: Request Managment

Windows XP (Darren’s laptop)
ColdFusion GM2
Via internal webserver.

Resolution: Won’t Fix
Last Updated: 30/Sep/09 1:55 PM
Affects Version: 1.0, 2.0, 2.0.3, 2.0.4, 3.0, 3.0.1, 3.5
Fixed Version: Pending
Server: ColdFusion 9
Platform: Windows XP, Windows 2000, Windows 2003, Linux, MacOS, Solaris, Windows Vista, Windows x64, Windows 7, Windows 2008
Related Issues: