diff --git a/core/src/main/java/com/qq/tars/support/log/LoggerFactory.java b/core/src/main/java/com/qq/tars/support/log/LoggerFactory.java index 8a9c1785..303cfb22 100644 --- a/core/src/main/java/com/qq/tars/support/log/LoggerFactory.java +++ b/core/src/main/java/com/qq/tars/support/log/LoggerFactory.java @@ -21,6 +21,7 @@ import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.joran.JoranConfigurator; import ch.qos.logback.core.joran.spi.JoranException; +import java.util.Objects; public class LoggerFactory { private static final LoggerContext logContext; @@ -38,7 +39,9 @@ public static int resetLogBack() { configurator.setContext(logContext); logContext.reset(); try { - configurator.doConfigure("logback.xml"); + + configurator.doConfigure( + Objects.requireNonNull(LoggerFactory.class.getClassLoader().getResource("logback.xml"))); return 0; } catch (JoranException e) { e.printStackTrace();