如何关闭 Eclipse 中的 Tomcat 日志记录?

如何关闭 Eclipse 中的 Tomcat 日志记录?

我在 Eclipse 中开发了一个 Vaadin 项目,通过 Tomcat 6 启动,而 Tomcat 6 可直接由 Eclipse 启动。但是,Tomcat 每次启动时都会打印大量日志消息,这使得我很难看到自己的应用程序的输出。我已经用tomcat6/conf/logging.propertiesWARNING例如java.util.logging.ConsoleHandler.level = WARNING)替换了所有日志级别,但仍然收到很多INFO消息。我该如何关闭此功能或将日志消息限制为WARNING

消息示例

Okt 26, 2012 12:16:36 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.24.
Okt 26, 2012 12:16:36 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Okt 26, 2012 12:16:36 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:saim' did not find a matching property.
Okt 26, 2012 12:16:37 PM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Okt 26, 2012 12:16:37 PM org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
Okt 26, 2012 12:16:37 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 879 ms
Okt 26, 2012 12:16:37 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Okt 26, 2012 12:16:37 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
Okt 26, 2012 12:16:37 PM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Okt 26, 2012 12:16:37 PM org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
Okt 26, 2012 12:16:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 568 ms

答案1

查看 ${catalina.base}/conf/logging.properties。这是设置 tomcat 日志记录级别的地方。

你可能想把它调到WARNINFO/FINE

更多信息:http://tomcat.apache.org/tomcat-6.0-doc/logging.html

相关内容