How to disable localhost_access_log files for ColdFusion/Tomcat

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 17:03:50

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/23669996/how-to-disable-localhost-access-log-files-for-coldfusion-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!