Upgrade to Logback 1.4.6

This commit includes a change to stop using an API in Logback that
has been deprecated without replacement. As Logback now only supports
.xml configuration files, it would only ever have thrown an
exception. The call to the API has been replaced with thrown an
exception directly.

Closes gh-34686
pull/34677/head
Andy Wilkinson 2 years ago
parent 9622b2b2eb
commit 73ee97b095

@ -783,7 +783,7 @@ bom {
]
}
}
library("Logback", "1.4.5") {
library("Logback", "1.4.6") {
group("ch.qos.logback") {
modules = [
"logback-access",

@ -33,7 +33,6 @@ import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.classic.jul.LevelChangePropagator;
import ch.qos.logback.classic.turbo.TurboFilter;
import ch.qos.logback.classic.util.ContextInitializer;
import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.spi.FilterReply;
import ch.qos.logback.core.status.OnConsoleStatusListener;
@ -272,13 +271,13 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem implements BeanF
private void configureByResourceUrl(LoggingInitializationContext initializationContext, LoggerContext loggerContext,
URL url) throws JoranException {
if (url.toString().endsWith("xml")) {
if (url.toString().endsWith(".xml")) {
JoranConfigurator configurator = new SpringBootJoranConfigurator(initializationContext, this.configurators);
configurator.setContext(loggerContext);
configurator.doConfigure(url);
}
else {
new ContextInitializer(loggerContext).configureByResource(url);
throw new IllegalArgumentException("Unsupported file extension in '" + url + "'. Only .xml is supported");
}
}

Loading…
Cancel
Save