Tomcat 7 日志记录仍然发出 FINE 和 FINER 日志记录,尽管 INFO 在任何地方都设置了
我试图平息Tomcat 7开箱即用的可笑的日志记录量。
对于每个请求,我都会得到这样的日志记录量:
FINE: Security checking request POST /myurl
Aug 28, 2015 7:17:08 AM org.apache.catalina.authenticator.AuthenticatorBase invoke
FINE: Not subject to any constraint
Aug 28, 2015 7:17:08 AM org.apache.catalina.core.StandardWrapper allocate
FINER: Returning non-STM instance
Aug 28, 2015 7:17:08 AM org.apache.catalina.authenticator.AuthenticatorBase invoke
我已经将我的$CATALINA_HOME/conf/logging.properties设置为这个,但无济于事。
(我基本上采用了默认的日志记录属性,并将所有内容都切换为信息。还添加了org.apache.catalina.level = INFO
)
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.
FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
org.apache.catalina.level = INFO
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.
4host-manager.org.apache.juli.FileHandler.level = INFO
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
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 org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = INFO
# To see debug messages in TldLocationsCache, uncomment the following line:
#org.apache.jasper.compiler.TldLocationsCache.level = INFO
我仍然收到FINE和FINER日志消息。
编辑:更多信息。我在docker中使用tomcat,这个特定的图像。
这是一个非常简单的安装,没有分裂的底座或任何东西:
ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH
RUN mkdir -p "$CATALINA_HOME"
WORKDIR $CATALINA_HOME
更新
我切换到log4j记录器,如这里和这里解释的那样。(第一个链接中的一个小错误 - tomcat-juli-adapter.jar进入lib/,而不是bin/)。这解决了我的问题,但不是开箱即用的雄猫记录器。不过,我会把这个问题留在这里。