import java.util.List; import org.slf4j.LoggerFactory; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.LoggerContext; public class TestMainLog{ public static void main(String[] args) { LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); List<ch.qos.logback.classic.Logger> loggerList = loggerContext.getLoggerList(); loggerList.forEach(logger -> { logger.setLevel(Level.INFO); }); } }
引用出处:https://www.cnblogs.com/lingyao/p/13614947.html