Reputation: 33
When I deployed my .war
file on tomcat server it will print debug and info log messages for every response automatically. I try to solve it but no way to find where it come from tomcat if there is any setting for config file in tomcat please tell me to stop this messages because my catalina.out
file size increase so much I need to stop
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“}}
Upvotes: 0
Views: 23781
Reputation: 1
I was facing the same issue. I wanted to disable all the INFO and DEBUG logs in spring. After trying so many things I found a solution to this. I changed the run configuration of my project like this.
Right click on your project -> Runs As -> Run Configuration.
In the left side choose your tomcat server.
In the right side select the Arguments tab and in VM arguments edit or add the below lines:
-Dcatalina.base="C:\Program Files\Apache Software Foundation\Tomcat 8.0" -Dcatalina.home="C:\Program Files\Apache Software Foundation\Tomcat 8.0" -Dwtp.deploy="C:\Program Files\Apache Software Foundation\Tomcat 8.0\wtpwebapps" -Djava.endorsed.dirs="C:\Program Files\Apache Software Foundation\Tomcat 8.0\endorsed"
Note: Change these lines according to your tomcat installation. Just replace C:\Program Files\ with your tomcat installation path.
Upvotes: 0
Reputation: 552
if you are using the Tomcat default logging (java.util.Logging), you need to configure the Logging level in ${catalina.base}/conf/logging.properties.
You should specify org.apache.catalina.level=INFO if you don't want to see DEBUG logs.
for details on how to adjust the Tomcat's logging for various Log API's refer: https://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_java.util.logging_(default)
Upvotes: 3