修改org.slf4j.Logger时,修改默认配置文件位置

File logbackFile = new File(ConstantsTools.PATH_LOG_CONFIG);
if (logbackFile.exists()) {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(lc);
lc.reset();
try {
configurator.doConfigure(logbackFile);
}
catch (JoranException e) {
e.printStackTrace(System.err);
System.exit(-1);
}
}
posted @ 2018-08-11 02:33  aloneOnWorld  阅读(5495)  评论(0编辑  收藏  举报