如何打开调试和信息日志的Tomcat的catalina.out的文件?

问题描述 投票:0回答:2

当我部署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“}}
java tomcat logging
2个回答
1
投票

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

您应指定org.apache.catalina.level = INFO,如果你不希望看到的调试日志。

关于如何调整Tomcat的日志记录各种日志API的详情,请参阅:qazxsw POI


0
投票

我面临着同样的问题。我想禁用春天所有的信息和调试日志。尝试这么多事情之后,我找到了解决这个。我改变了我的计划是这样的运行配置。 右键点击你的项目 - >运行方式 - >运行配置。在左侧选择Tomcat服务器。 在右侧选择VM参数编辑参数选项卡,或添加下面几行:

-Dcatalina.base = “C:\ Program Files文件\ Apache软件基金会\ Tomcat的8.0” -Dcatalina.home = “C:\ Program Files文件\ Apache软件基金会\ Tomcat的8.0” -Dwtp.deploy =“C:\ Program Files文件\ Apache软件基金会\ Tomcat的8.0 \ wtpwebapps” -Djava.endorsed.dirs = “C:\ Program Files文件\ Apache软件基金会\ Tomcat的8.0 \赞同”

注:根据您的tomcat安装更改这些行。只需更换C:\ Program Files文件\你的tomcat安装路径。

© www.soinside.com 2019 - 2024. All rights reserved.