Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable localhost_access_log files for ColdFusion/Tomcat

I was running out of disk space on a web server. Since the logs are stored on another drive and there wasn't any new files for the web sites, there had to be something else going on.

I found that the Tomcat service that comes with ColdFusion 10 was writing log files for every web page request in this folder {ColdFusion Root}\cfusion\runtime\logs. They accounted for 8GB of disk space!

The filenames were in this format: localhost_access_log.YYYY-MM-DD.txt

If you are running a single site on your ColdFusion server, this may be OK. The problem with the log files is that they only display the SCRIPT_NAME and QUERY_STRING for the request. You won't be able to tell which site the "/index.cfm" request is for. Maybe it can be configured to include the site hostname.

I would rather disable this logging as IIS logging is more informative.

like image 483
Scott Jibben Avatar asked May 15 '14 05:05

Scott Jibben


1 Answers

Edit this file: {ColdFusion Root}\cfusion\runtime\conf\server.xml

Find this line:

    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
           prefix="localhost_access_log." suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>

Comment out the line like this:

    <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
           prefix="localhost_access_log." suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/> -->

Save the file.

Restart the ColdFusion service.

like image 131
Scott Jibben Avatar answered Nov 16 '22 14:11

Scott Jibben