CF Muse Reader Asks:
On our CF 6.1 server, we have a /CFusionMX/runtime/logs/default-err.log file that is over 100MB in size. Is there a good way to knock that down, or is it okay to just delete the thing?
First things first, yes it is fine to delete this file. Make sure you know why it is growing so large - there may be errors you should be concerned about, and this file merits your review. In order to delte the file you will have to stop coldfusion. Upon a restarting Coldfusion will actually recreate the file starting with a nice tidy 1 kilobyte. You might notice that the "event" log actually "rolls over" every 200k. Wouldn't it be nice if the err log did that too? It can...
There are additional parameters that are configurable for the Jrun logs. The default installation only specifies these parameters for the event log. Why? Because of a simple flaw in the Jrun.xml file. Look in the Jrun.xml file (found in cfusionmx/runtime/bin). You will see a section like the following:
Notice that the "FileLogEventHandler" has some extra attributes. One of them is a file name attribute. Which is "hard coded" to be the server name plus "-event.log". Because this group of attributes is specified to only apply to the "-event" log, the attribute "rotationSize" is only ever checked for that file. However, if you change this line:
Since the -err log and -out log now "rollover" there is no need to stop the service. You can clean out the directory by deleting old log files that are no longer open. They will exist with an "_1" or "_2" etc. in the name.
See this Macromedia Technote for more information.