Tomcat6 部分忽略了 logging.properties

编程入门 行业动态 更新时间:2024-10-27 22:23:57
本文介绍了Tomcat6 部分忽略了 logging.properties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我使用的是 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.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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 03:53:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1389249.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:忽略了   properties   logging

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!