Starting with version slf4j 1.7.26 I was able to change the logging level.
Here is logback.xml in the source folder. In the case of the spring boot application, you can place it in the resources folder.
<configuration scan="true" scanPeriod="20000"> <include file="C:/logback-ext.xml"/> </configuration>
The logback-ext.xml is stored in any external location. scanPeriod in milliseconds. If unsuccessful, try using include resource instead of include file in logback.xml .
<included> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern> %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] --- %c{1}.%M:%L :: %m %n </pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref="STDOUT" /> </root> </included>
I managed to change the logging level, logging template, attach / detach new ones and add / remove add-on devices.
These are dependencies in pom.xml
<dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.25</version> </dependency>
Hooray!
ScottSummers
source share