Tomcat应用程序生成过多日志
我有一个在 linux ubuntu 服务器上的 tomcat 6.0.20 服务器上运行的应用程序。
它在catalina.out文件夹中生成大量日志,其中大部分是在使用应用程序时生成的,但不是由应用程序生成的。
下面给出了它生成的一些日志,
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: startElement(,,mime-type)
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: Pushing body text '
'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: New match='web-app/mime-mapping/mime-type'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: Fire begin() for CallParamRule[paramIndex=1, attributeName=null, from stack=false]
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester characters
FINE: characters(audio/x-mpeg)
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: endElement(,,mime-type)
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: match='web-app/mime-mapping/mime-type'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: bodyText='audio/x-mpeg'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: Fire body() for CallParamRule[paramIndex=1, attributeName=null, from stack=false]
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: Popping body text '
如何将它们关闭?这非常重要,因为这是一个生产应用程序。
问候, 罗希特
I have an application which runs on tomcat 6.0.20 server on linux ubuntu server.
It generates a huge amount of logs in the catalina.out folder, most of these are generated while using the application, but are not generated by the application.
Some of the logs it generates are given below,
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: startElement(,,mime-type)
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: Pushing body text '
'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: New match='web-app/mime-mapping/mime-type'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester startElement
FINE: Fire begin() for CallParamRule[paramIndex=1, attributeName=null, from stack=false]
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester characters
FINE: characters(audio/x-mpeg)
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: endElement(,,mime-type)
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: match='web-app/mime-mapping/mime-type'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: bodyText='audio/x-mpeg'
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: Fire body() for CallParamRule[paramIndex=1, attributeName=null, from stack=false]
Apr 16, 2010 2:55:24 PM org.apache.tomcat.util.digester.Digester endElement
FINE: Popping body text '
How can I turn them off? This is very important, since this a production application.
Regards,
Rohit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当logging.properties也有.level=INFO时,我遇到了这个问题。
问题原来是我的一个共享库中也有一个logging.properties(并且设置了.level = FINEST)。
我通过编辑 catalina.properties 并确保包含logging.properties的目录位于shared.loader类路径中的第一个目录来修复了该问题。
I had this issue when logging.properties has .level=INFO as well.
The problem turned out to be that one of my shared libraries has a logging.properties in it as well (and this set .level=FINEST).
I fixed the issue by editing catalina.properties and making sure a directory containing logging.properties was first in the shared.loader classpath.
看来,这些语句是通过 Java 的内置记录器 (java.util.logger) 发出的。无论出于何种原因,您的环境都配置为记录“精细”级别的消息。此级别通常用于调试输出,是的,您通常不会在生产中保留它。
如果我没记错的话,Tomcat 使用文件
conf/logging.properties
配置 Java 记录器。您需要在生产中对其进行编辑。有关该文件含义的信息如下: http:// /java.sun.com/javase/6/docs/technotes/guides/logging/overview.html但基本上您希望将文件中出现的“FINE”替换为“INFO”。
These statements are coming via Java's built-in logger (java.util.logger), it appears. For whatever reason, you have your environment configured to log level "fine" messages. This level is typically used for debug output and yes, you never typically leave it on in production.
If I'm not mistaken, Tomcat configures the Java logger with the file
conf/logging.properties
. You'll want to edit this in production. Info on what the file means is here: http://java.sun.com/javase/6/docs/technotes/guides/logging/overview.htmlBut basically you want to replace occurrences of "FINE" with "INFO" in the file.
已经做出了这些改变,但这似乎没有帮助,
Have already made those changes, but this doesn't seem to be helping,
运行\Tomcat 8.0\bin\Tomcat8w.exe
在“日志记录”选项卡中,将重定向标准输出更改为空白“”;(默认情况下为“自动”)
RUN \Tomcat 8.0\bin\Tomcat8w.exe
In logging tab, change the redirect stdout to blank " " ;(it's "auto" by default)