如何为ColdFusion / Tomcat禁用localhost_access_log文件 [英] How to disable localhost_access_log files for ColdFusion/Tomcat

查看:107
本文介绍了如何为ColdFusion / Tomcat禁用localhost_access_log文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Web服务器上的磁盘空间不足。由于日志存储在另一个驱动器上,并且该网站没有任何新文件,因此必须进行其他操作。

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.

我发现Tomcat ColdFusion 10附带的服务正在为此文件夹{ColdFusion Root} cfusion runtime logs中的每个网页请求编写日志文件。他们占了8GB的磁盘空间!

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!

文件名的格式为:localhost_access_log.YYYY-MM-DD.txt

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

如果您在ColdFusion服务器上运行单个站点,则可能可以。日志文件的问题在于它们仅显示该请求的SCRIPT_NAME和QUERY_STRING。您将无法确定 /index.cfm请求所针对的网站。

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.

我宁愿禁用此日志记录,因为IIS日志记录更有用。

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

推荐答案

编辑此文件:
{ColdFusion Root} \cfusion\runtime\conf\server.xml

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

查找此行:

    <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"/>

注释如下:

    <!-- <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"/> -->

保存文件。

重新启动ColdFusion服务。

Restart the ColdFusion service.

这篇关于如何为ColdFusion / Tomcat禁用localhost_access_log文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆