Tomcat6 部分忽略了 logging.properties [英] Tomcat6 ignores logging.properties partially

查看:52
本文介绍了Tomcat6 部分忽略了 logging.properties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Tomcat 6,这是我的 logging.properties:

I'm using Tomcat 6, and this is my logging.properties:

handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.level=FINE

org.apache.catalina.core.ApplicationContext.level = OFF

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

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

一方面,Tomcat 似乎读取了这个文件,因为它正确地保存了带有前缀mylog"的日志文件,并且只打印日志级别为 FINE 及以上的消息.另一方面,它会继续写这样的日志消息:

On the one hand, Tomcat seems to read this file, as it correctly saves the logfiles with the prefix "mylog" and prints only messages with log-level FINE and above. On the other hand, it keeps on writing log messages like this:

Jun 8, 2010 9:53:30 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Error writing messages
ClientAbortException:  java.net.SocketException: Broken pipe

我实际上想抑制来自该类的所有日志消息,因为它们淹没了我的日志文件,并且该错误与我无关.那么为什么以下行被忽略了?

I actually wanted to suppress all log messages from this class, as they flood my logfile, and the error is irrelevant for me. So why is the following line ignored?

org.apache.catalina.core.ApplicationContext.level = OFF

有没有其他方法可以抑制这个类的日志输出?

Is there any other way to suppress the log output of this class?

推荐答案

org.apache.catalina.core.ApplicationContext 不是 ApplicationContext 中使用的记录器的名称,它使用的是复合:org.apache.catalina.core.StandardContext 的日志.

org.apache.catalina.core.ApplicationContext is not the name of the logger used in ApplicationContext, it uses the log of a composite: the org.apache.catalina.core.StandardContext's log.

--也许是因为它们是上下文记录器.然后他们需要进行不同的配置

--edit: Maybe it's because they're context loggers. Then they need to be configured differently

类似的东西

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

我以前没有这样做过,我从来没有使用过tomcat的日志工具,也没有太多信息查找

I've not done that before, I've never used tomcat's logging facilities, and there is not much info to find

这篇关于Tomcat6 部分忽略了 logging.properties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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