|
|
|
@ -49,6 +49,7 @@ import org.springframework.boot.logging.LoggingInitializationContext;
|
|
|
|
|
import org.springframework.boot.logging.LoggingSystem;
|
|
|
|
|
import org.springframework.boot.logging.LoggingSystemProperties;
|
|
|
|
|
import org.springframework.boot.logging.Slf4JLoggingSystem;
|
|
|
|
|
import org.springframework.core.SpringProperties;
|
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
import org.springframework.util.ResourceUtils;
|
|
|
|
@ -65,6 +66,9 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
*/
|
|
|
|
|
public class LogbackLoggingSystem extends Slf4JLoggingSystem {
|
|
|
|
|
|
|
|
|
|
// Static final field to facilitate code removal by Graal
|
|
|
|
|
private static final boolean XML_ENABLED = !SpringProperties.getFlag("spring.xml.ignore");
|
|
|
|
|
|
|
|
|
|
private static final String CONFIGURATION_FILE_PROPERTY = "logback.configurationFile";
|
|
|
|
|
|
|
|
|
|
private static final LogLevels<Level> LEVELS = new LogLevels<>();
|
|
|
|
@ -172,7 +176,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
|
|
|
|
|
|
|
|
|
|
private void configureByResourceUrl(LoggingInitializationContext initializationContext, LoggerContext loggerContext,
|
|
|
|
|
URL url) throws JoranException {
|
|
|
|
|
if (url.toString().endsWith("xml")) {
|
|
|
|
|
if (XML_ENABLED && url.toString().endsWith("xml")) {
|
|
|
|
|
JoranConfigurator configurator = new SpringBootJoranConfigurator(initializationContext);
|
|
|
|
|
configurator.setContext(loggerContext);
|
|
|
|
|
configurator.doConfigure(url);
|
|
|
|
|