情况:htmlunit jar包运势时候,出现了很多日志:
解决办法:
main方法中加入:
static { LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); List<Logger> loggerList = loggerContext.getLoggerList(); loggerList.forEach(logger -> { logger.setLevel(Level.OFF); }); }
附:
import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.LoggerContext;
标签:ch,qos,htmlunit,classic,jar,LoggerContext,日志,logback From: https://www.cnblogs.com/lixiuming521125/p/17765643.html