Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2cb4403

Browse files
mrifnisnicoll
authored andcommitted
Automatically detect log4j2.properties
See spring-projectsgh-16262
1 parent 1261c39 commit 2cb4403

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ protected String[] getStandardConfigLocations() {
112112

113113
private String[] getCurrentlySupportedConfigLocations() {
114114
List<String> supportedConfigLocations = new ArrayList<>();
115+
supportedConfigLocations.add("log4j2.properties");
115116
if (isClassAvailable("com.fasterxml.jackson.dataformat.yaml.YAMLParser")) {
116117
Collections.addAll(supportedConfigLocations, "log4j2.yaml", "log4j2.yml");
117118
}

‎spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public void loggingThatUsesJulIsCaptured() {
211211
@Test
212212
public void configLocationsWithNoExtraDependencies() {
213213
assertThat(this.loggingSystem.getStandardConfigLocations())
214-
.contains("log4j2.xml");
214+
.contains("log4j2.properties", "log4j2.xml");
215215
}
216216

217217
@Test
@@ -241,7 +241,8 @@ public void configLocationsWithJacksonDatabindAndDataformatYaml() {
241241
@Test
242242
public void springConfigLocations() {
243243
String[] locations = getSpringConfigLocations(this.loggingSystem);
244-
assertThat(locations).isEqualTo(new String[] { "log4j2-spring.xml" });
244+
assertThat(locations).isEqualTo(
245+
new String[] { "log4j2-spring.properties", "log4j2-spring.xml" });
245246
}
246247

247248
@Test

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /