File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 4949import org .springframework .boot .logging .LoggingSystem ;
5050import org .springframework .boot .logging .LoggingSystemProperties ;
5151import org .springframework .boot .logging .Slf4JLoggingSystem ;
52+ import org .springframework .core .SpringProperties ;
5253import org .springframework .core .env .Environment ;
5354import org .springframework .util .Assert ;
5455import org .springframework .util .ResourceUtils ;
6566 */
6667public class LogbackLoggingSystem extends Slf4JLoggingSystem {
6768
69+ // Static final field to facilitate code removal by Graal
70+ private static final boolean XML_ENABLED = !SpringProperties .getFlag ("spring.xml.ignore" );
71+
6872 private static final String CONFIGURATION_FILE_PROPERTY = "logback.configurationFile" ;
6973
7074 private static final LogLevels <Level > LEVELS = new LogLevels <>();
@@ -172,7 +176,7 @@ protected void loadConfiguration(LoggingInitializationContext initializationCont
172176
173177 private void configureByResourceUrl (LoggingInitializationContext initializationContext , LoggerContext loggerContext ,
174178 URL url ) throws JoranException {
175- if (url .toString ().endsWith ("xml" )) {
179+ if (XML_ENABLED && url .toString ().endsWith ("xml" )) {
176180 JoranConfigurator configurator = new SpringBootJoranConfigurator (initializationContext );
177181 configurator .setContext (loggerContext );
178182 configurator .doConfigure (url );
You can’t perform that action at this time.
0 commit comments