ColdFusion provides a built-in logging system to help you track and troubleshoot application issues. The logging system generates various log files, including the coldfusion-out.log file, which logs standard output and errors.
However, if left unmanaged, the coldfusion-out.log file can grow very large and consume a lot of disk space. In addition, it can become difficult to find relevant log entries in a large log file. Therefore, it is important to manage the coldfusion-out.log file and implement log rotation to keep it under control. Unfortunately, unlike other logs, we can’t control the size of coldfusion-out.log and rotate it via CF administrator.
Here are the steps to manage coldfusion-out.log and implement log rotation in ColdFusion:
Step 1: Navigate to the \ColdFusionxxxx\instance-name\lib location and edit the neo-logging.xml file. This file controls the logging settings for ColdFusion.
Step 2: Change the value for the “maxOutLogSize” parameter. The default size is 20 MB and can be increased or decreased per the requirement. The “maxFileBackup” parameter defines a maximum number of archives. After reaching this limit, files are deleted from oldest to newest.
<wddxPacket version="1.0"> <header/> <data> <array length="2"> <struct type="coldfusion.server.ConfigMap"> <var name="consoleVisible"> . . . <var name="maxOutLogSize"> <number>20.0</number> </var> <var name="maxFileBackup"> <number>10.0</number> </var> . . </struct> </array> </data> </wddxPacket>
Step 3: Save the neo-logging.xml file and restart ColdFusion services to apply the changes.
By implementing log rotation, you can ensure that the coldfusion-out.log file does not grow too large and the relevant log entries are easy to find. This can help you troubleshoot issues in your applications more efficiently and effectively.