A typical spring boot application sends INFO level messages to console. I know this root logger level can be changed in a logback xml config file. I have a need to change it through the spring boot application itself.
I am using spring boot2 with no logback xml file in my resources. With these lines in the class annotated
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.Level;
public static void main(String[] args) {
((Logger)org.slf4j.LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)).setLevel(Level.DEBUG);
...
}
with @SpringBootApplication, when I run the application, for some reason I am not seeing DEBUG messages.