Skip to content

Commit

Permalink
fix:fix log config not working bug in higher version Logback. (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeBeFreeman authored Feb 1, 2023
1 parent c0fd23f commit 4f783c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.util.ContextInitializer;
import com.tencent.polaris.logging.AbstractPolarisLogging;
import org.slf4j.LoggerFactory;
import org.slf4j.impl.StaticLoggerBinder;

public class LogbackPolarisLogging extends AbstractPolarisLogging {
Expand All @@ -34,7 +35,7 @@ public void loadConfiguration() {
}

try {
LoggerContext loggerContext = (LoggerContext) StaticLoggerBinder.getSingleton().getLoggerFactory();
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
new ContextInitializer(loggerContext).configureByResource(getResourceUrl(location));
} catch (Exception e) {
throw new IllegalStateException("could not initialize logback logging from " + location, e);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<properties>
<!-- Project revision -->
<revision>1.10.2</revision>
<revision>1.10.3</revision>

<timestamp>${maven.build.timestamp}</timestamp>
<skip.maven.deploy>false</skip.maven.deploy>
Expand Down

0 comments on commit 4f783c4

Please sign in to comment.