Per the spring boot documentation ( latest ), its mentioned that the spring boot uses logback internally.
I have used log4j starter as mentioned below excluding the logback
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
</dependency>
</dependencies>
and e.g. if below command is run in debug mode ( supposing sboot1 is my uber jar )
java -jar target\sboot1-1.0.jar --debug
I am not getting the debug logs which are generated earlier using logback which displays the "exclusions" and "inclusions" and other necessary info.
How to also get the --debug logs when using other logging frameworks like log4j?
SpringApplication? Like this:SpringApplication.run(YourApplication.class, args);- Andy Wilkinsonjava -jar target\sboot1-1.0.jar --debugafter uncommenting the log4j starter dependencies from pom.xml, those logs wont be printed and try the other way by commenting, the logs will be printed with logback dependency. - Kartik Narayana Maringanti