Tomcat应用程序生成过多日志

发布于 2024-08-28 19:26:16 字数 1466 浏览 6 评论 0原文

我有一个在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

最笨的告白 2024-09-04 19:26:16

当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.

冷弦 2024-09-04 19:26:16

看来,这些语句是通过 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.html

But basically you want to replace occurrences of "FINE" with "INFO" in the file.

南七夏 2024-09-04 19:26:16

已经做出了这些改变,但这似乎没有帮助,

I have already changed all the properties to SEVER and INFO, but the logs still keep on generating.

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

1catalina.org.apache.juli.FileHandler.level = SEVERE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.

2localhost.org.apache.juli.FileHandler.level = SEVERE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.

3manager.org.apache.juli.FileHandler.level = SEVERE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.

4host-manager.org.apache.juli.FileHandler.level = SEVERE
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.

java.util.logging.ConsoleHandler.level = SEVERE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE
#org.apache.catalina.core.AprLifecycleListener.level=FINE
-- INSERT --                                             

Have already made those changes, but this doesn't seem to be helping,

I have already changed all the properties to SEVER and INFO, but the logs still keep on generating.

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

1catalina.org.apache.juli.FileHandler.level = SEVERE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.

2localhost.org.apache.juli.FileHandler.level = SEVERE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.

3manager.org.apache.juli.FileHandler.level = SEVERE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.

4host-manager.org.apache.juli.FileHandler.level = SEVERE
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.

java.util.logging.ConsoleHandler.level = SEVERE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE
#org.apache.catalina.core.AprLifecycleListener.level=FINE
-- INSERT --                                             
Saygoodbye 2024-09-04 19:26:16

运行\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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文