使用Tomcat 7降低Eclipse WTP中的日志级别 [英] Decreasing log level in Eclipse WTP with Tomcat 7

查看:205
本文介绍了使用Tomcat 7降低Eclipse WTP中的日志级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Eclipse WTP(Juno)中运行Tomcat 7,我似乎无法调低日志记录级别。它记录从调试太多到任何用途的所有东西(我想要从INFO记录)。 logging.properties文件如下:

  handlers = java.util.logging.ConsoleHandler 

$。$。 ######################################
#处理程序的特定属性。
#描述处理程序的具体配置信息。
########################################################## ##############

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


解决方案

添加根据Tom Chatt引用的常见问题解答

  -Djava.util.logging.manager = org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file = $ {workspace_loc} /。metadata / .plugins / org.eclipse.wst.server.core / tmp0 / conf / logging.properties

到服务器的启动配置的参数会让你想要的。
$ {workspace_loc} 是文字; Eclipse将其替换为您的工作空间目录。
tmp0 可能是 tmp1 使用与服务器配置中相同的路径。
当然,假设您已经将 logging.properties 文件放在那里。
这样,您将在Project Explorer窗口的Servers下看到该文件。
您应该从Tomcat conf 目录中复制一个。



这一切都假定你使用JULI的意图。



在Tomcat 8.0和Eclipse Mars中为我工作。
不知道为什么它不适用于汤姆。
我看到 ClassNotFound s,显而易见的原因是当我从某人的帖子中使用了错误的类名。


$ b $我建议反对Tom Chatt的方法,因为这将影响该JVM的所有其他用途。


I am running Tomcat 7 from within Eclipse WTP (Juno) and I cannot seem to tune down the logging level. It logs everything from debug which is too verbose to be of any use (I want it log from INFO). The logging.properties file is as follows:

handlers =  java.util.logging.ConsoleHandler

.handlers = java.util.logging.ConsoleHandler

.level=INFO

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

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

解决方案

Adding both of these per the FAQ that Tom Chatt cites:

-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="${workspace_loc}/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/logging.properties"

to the arguments to the server's launch configuration will get you what you want. ${workspace_loc} is literal; Eclipse will substitute it with your workspace directory. tmp0 may be tmp1 or such instead; use the same path that's in the server's configuration. Assumes that you've placed the logging.properties file there, of course. That way you'll see the file in the Project Explorer window under Servers. You should start by copying the one from the Tomcat conf directory.

This all assumes that you're intent on using JULI.

Works for me with Tomcat 8.0 and Eclipse Mars. No idea why it didn't work for Tom. I did see ClassNotFounds, for the obvious reason, when I used the wrong class name from someone's post.

I'd advise against the approach of Tom Chatt, since that will affect all of the other uses of that JVM.

这篇关于使用Tomcat 7降低Eclipse WTP中的日志级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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