Merge branch '2.1.x'

This commit is contained in:
Stephane Nicoll
2019-03-29 15:58:00 +01:00
2 changed files with 5 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -112,6 +112,7 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem {
private String[] getCurrentlySupportedConfigLocations() {
List<String> supportedConfigLocations = new ArrayList<>();
supportedConfigLocations.add("log4j2.properties");
if (isClassAvailable("com.fasterxml.jackson.dataformat.yaml.YAMLParser")) {
Collections.addAll(supportedConfigLocations, "log4j2.yaml", "log4j2.yml");
}

View File

@@ -210,7 +210,7 @@ public class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
@Test
public void configLocationsWithNoExtraDependencies() {
assertThat(this.loggingSystem.getStandardConfigLocations())
.contains("log4j2.xml");
.contains("log4j2.properties", "log4j2.xml");
}
@Test
@@ -240,7 +240,8 @@ public class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
@Test
public void springConfigLocations() {
String[] locations = getSpringConfigLocations(this.loggingSystem);
assertThat(locations).isEqualTo(new String[] { "log4j2-spring.xml" });
assertThat(locations).isEqualTo(
new String[] { "log4j2-spring.properties", "log4j2-spring.xml" });
}
@Test