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 49
49
import org .springframework .boot .logging .LoggingSystem ;
50
50
import org .springframework .boot .logging .LoggingSystemProperties ;
51
51
import org .springframework .boot .logging .Slf4JLoggingSystem ;
52
+ import org .springframework .core .SpringProperties ;
52
53
import org .springframework .core .env .Environment ;
53
54
import org .springframework .util .Assert ;
54
55
import org .springframework .util .ResourceUtils ;
65
66
*/
66
67
public class LogbackLoggingSystem extends Slf4JLoggingSystem {
67
68
69
+ // Static final field to facilitate code removal by Graal
70
+ private static final boolean XML_ENABLED = !SpringProperties .getFlag ("spring.xml.ignore" );
71
+
68
72
private static final String CONFIGURATION_FILE_PROPERTY = "logback.configurationFile" ;
69
73
70
74
private static final LogLevels <Level > LEVELS = new LogLevels <>();
@@ -172,7 +176,7 @@ protected void loadConfiguration(LoggingInitializationContext initializationCont
172
176
173
177
private void configureByResourceUrl (LoggingInitializationContext initializationContext , LoggerContext loggerContext ,
174
178
URL url ) throws JoranException {
175
- if (url .toString ().endsWith ("xml" )) {
179
+ if (XML_ENABLED && url .toString ().endsWith ("xml" )) {
176
180
JoranConfigurator configurator = new SpringBootJoranConfigurator (initializationContext );
177
181
configurator .setContext (loggerContext );
178
182
configurator .doConfigure (url );
You can’t perform that action at this time.
0 commit comments