2

请参阅下面的解决方案,错误描述有点模糊,因为不知道出了什么问题。

我正在尝试在linux上部署一个新的tomcat7,以便以后克隆整个机器,所以现在想正确设置它。Tomcat itsel 可以正常启动,但是当尝试通过将 war 文件复制到 webapps 目录来部署我们的应用程序时,catalina 错误输出文件被大约 50MB 的 FINE 日志淹没(请参见下面的一部分),并且没有任何内容被放入正常的输出文件和正常的日志文件。

与 tomcat 文档 (\appdev\sample\sample.war) 一起提供的 sample.war 文件不会发生同样的情况,它以通常的一些日志行启动。

logging.properties 文件是默认文件,其中每个“FINE”都替换为“INFO”,其他所有 tomcat 文件也未修改。

什么定制的:tomcat是用jsvc和定制的启动脚本运行的。CATALINA_BASE与非 root 用户分离CATALINA_HOME并以非 root 用户运行 tomcat。编辑:不确定是否重要,但启动脚本设置了有关日志记录的这些启动参数:-Djava.util.logging.config.file=<logging.proprties' path> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager并且控制台输出和控制台输出错误由启动脚本设置。

大部分错误文件的内容来自类org.apache.tomcat.util.digester.Digester,看起来无害的 FINE 级别日志。

没有 SEVERE、ERROR 日志,并且有一个关于某些未设置区域设置的 WARNING 以及下面的这个,但它们几乎在日志的末尾:

Jul 31, 2013 12:34:24 PM org.apache.myfaces.component.html.util.ExtensionsFilter <init>
WARNING: Please adjust your web.xml to use org.apache.myfaces.webapp.filter.ExtensionsFilter

logging.properties 现在看起来像这样:

handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler
.handlers = 1catalina.org.apache.juli.FileHandler

############################################################
# Handler specific properties.

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

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

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

############################################################
# Facility specific properties.

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.commons.digester.Digester.[Catalina].level = INFO
org.apache.commons.digester.Digester.[Catalina].handlers = 1catalina.org.apache.juli.FileHandler

org.apache.commons.digester.Digester.[Catalina].[localhost].level = INFO
org.apache.commons.digester.Digester.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler

org.apache.commons.digester.Digester.[Catalina].[localhost].[/manager].level = INFO
org.apache.commons.digester.Digester.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler

EDIT2:添加了设施特定的属性,org.apache.tomcat.util.digester.Digester但没有成功


为什么日志进入输出文件,而不是进入日志文件?sample.war 的日志同时显示,但每次启动/停止只有几行。无论目的地如何,当一切都设置为 INFO 时,为什么会有任何 FINE 日志记录?

所以请注意我可能做错了什么。我可以获取应用程序的源代码并检查并修改其中的内容,但我不知道它的内部结构。即使其中有错误,我认为这个错误输出文件也不应该这么大,并且日志记录应该在默认配置下正常工作。

4

1 回答 1

0

The solution comes from Mustafa Yuksel, described here. The guy is a hero, we had the exact same issues and we couldn't figure them out in weeks.

The first issue was that the war file does not use org.apache.tomcat.util.digester.Digester, it was in fact the org.apache.commons.digester.Digester.level class which used the wrong logger. So that you can mask the FINE logging with the line

org.apache.commons.digester.Digester.level = INFO

The second issue was that we had a logging.properties in a project, that we had Eclipse include in our war files. That project included an additional logging.properties file which we had no idea about. Included eclipse projects are present as jar files in /WEB-INF/lib/ so you have to dig into those.

于 2013-08-08T11:24:34.973 回答