日志bug,临时测试
This commit is contained in:
@@ -67,10 +67,11 @@ public class NacosLogbackConfigLoader implements SpringApplicationRunListener, A
|
||||
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||
JoranConfigurator configurator = new JoranConfigurator();
|
||||
configurator.setContext(context);
|
||||
context.reset();
|
||||
// 注意:变量名必须与 XML 中 ${...} 内的名称完全一致
|
||||
context.putProperty("log.projectName", projectName != null ? projectName : "undefined_pqs");
|
||||
context.putProperty("log.commonLevel", logLevel != null ? logLevel : "INFO");
|
||||
context.reset();
|
||||
|
||||
try (ByteArrayInputStream inputStream = new ByteArrayInputStream(logbackConfigContent.getBytes(StandardCharsets.UTF_8))) {
|
||||
configurator.doConfigure(inputStream);
|
||||
Logger root = context.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
|
||||
|
||||
Reference in New Issue
Block a user