java - 如何关闭 tomcat catalina.out 文件的调试和信息日志?

标签 java tomcat logging

当我在 tomcat 服务器上部署我的 .war 文件时,它会自动为每个响应打印调试和信息日志消息。我尝试解决它但无法找到它来自 tomcat 的位置如果 tomcat 中的配置文件有任何设置请告诉我停止此消息因为我的 catalina.out 文件大小增加了很多我需要停止

09:54:48.977 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#1'
09:54:48.978 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#2'
09:54:49.453 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#2'
09:54:49.454 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#3'
09:54:49.696 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#3'
09:54:49.696 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#4'
09:54:50.054 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#4'
09:54:50.055 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#5'
09:54:50.417 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#5'
09:54:50.418 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#6'
09:54:51.135 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#6'
09:54:51.136 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#7'
09:54:51.853 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#7'
09:54:51.853 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#8'
09:54:54.716 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#8'
09:54:54.831 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0'
09:54:55.370 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0'
09:54:55.370 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.handler.MappedInterceptor#0'
09:54:55.370 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0'
09:54:55.370 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0'
09:54:55.487 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0' to allow for resolving potential circular references
10:06:27.851 [http-nio-8081-exec-10] DEBUG o.s.w.s.m.m.a.HttpEntityMethodProcessor - Written [{"data":{"code":success,"message":{"title":"Title“}}

最佳答案

如果您使用的是 Tomcat 默认日志记录 (java.util.Logging),则需要在 ${catalina.base}/conf/logging.properties 中配置日志记录级别。

如果您不想看到 DEBUG 日志,您应该指定 org.apache.catalina.level=INFO。

有关如何针对各种日志 API 调整 Tomcat 日志记录的详细信息,请参阅:https://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_java.util.logging_(default)

关于java - 如何关闭 tomcat catalina.out 文件的调试和信息日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37225779/

相关文章:

java - Controller 中缺少参数时如何自动返回405

java - 在 Websphere WebApp 中将 JUL 重定向到 Log4J2

javascript - rails : How can I log on which site my javascript is embedded?

Java 7 |我们可以并行下载 applet JAR 吗?

java - 为什么在 Java 中没有指针时 Java 有一个 "NullPointerException"?

java - 冒泡排序不起作用

tomcat自动启动servlet

OracleDataSourceFactory 返回 null

java - 奇怪的 Tomcat 和 Axis Webservice 行为

database - 什么数据库足以用于日志记录应用程序?