I have some trouble getting rid of debug messages generated by Spring (similiar to the following ones; there are thousands of those entries):
19:58:08.380 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'propertyPlaceholderConfigurer'
19:58:08.380 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'propertyPlaceholderConfigurer'
19:58:08.383 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'appConfig'
19:58:08.383 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'appConfig'
19:58:08.383 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'appConfig' to allow for resolving potential circular references
19:58:08.384 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'appConfig'
In related questions, there were many suggestions involving log4j, web.xml, ....
However, I am not using any of those - I simply instantiate an AnnotationConfigApplicationContext
and start creating beans.
In my pom.xml file, there are no references to any logging framework - I only include the spring dependencies:
<!-- Spring and Transactions -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<!-- ... -->
<artifactId>spring-tx</artifactId>
<!-- ... -->
<artifactId>spring-boot-starter</artifactId>
<!-- ... -->
<artifactId>spring-web</artifactId>
<!-- ... -->
I read somewhere that Spring seems to use "Commons logging" by default, which I unsuccessfully tried to disable using (as shown in Turn Off Apache Common Logging ):
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
In addition, I tried to exclude the commons logging in my pom.xml by adding:
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
Still no luck, however.
Next, I tried including a dependency to log4j, hoping this would override the default logging. As the format of the messages stayed the same, it seems that this attempt was also not successfull.
What could I try next?