Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
2cb4403c
Commit
2cb4403c
authored
Mar 19, 2019
by
Mohamed Rifni
Committed by
Stephane Nicoll
Mar 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically detect log4j2.properties
See gh-16262
parent
1261c396
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Log4J2LoggingSystem.java
...ingframework/boot/logging/log4j2/Log4J2LoggingSystem.java
+1
-0
Log4J2LoggingSystemTests.java
...amework/boot/logging/log4j2/Log4J2LoggingSystemTests.java
+3
-2
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java
View file @
2cb4403c
...
@@ -112,6 +112,7 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem {
...
@@ -112,6 +112,7 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem {
private
String
[]
getCurrentlySupportedConfigLocations
()
{
private
String
[]
getCurrentlySupportedConfigLocations
()
{
List
<
String
>
supportedConfigLocations
=
new
ArrayList
<>();
List
<
String
>
supportedConfigLocations
=
new
ArrayList
<>();
supportedConfigLocations
.
add
(
"log4j2.properties"
);
if
(
isClassAvailable
(
"com.fasterxml.jackson.dataformat.yaml.YAMLParser"
))
{
if
(
isClassAvailable
(
"com.fasterxml.jackson.dataformat.yaml.YAMLParser"
))
{
Collections
.
addAll
(
supportedConfigLocations
,
"log4j2.yaml"
,
"log4j2.yml"
);
Collections
.
addAll
(
supportedConfigLocations
,
"log4j2.yaml"
,
"log4j2.yml"
);
}
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java
View file @
2cb4403c
...
@@ -211,7 +211,7 @@ public class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
...
@@ -211,7 +211,7 @@ public class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
@Test
@Test
public
void
configLocationsWithNoExtraDependencies
()
{
public
void
configLocationsWithNoExtraDependencies
()
{
assertThat
(
this
.
loggingSystem
.
getStandardConfigLocations
())
assertThat
(
this
.
loggingSystem
.
getStandardConfigLocations
())
.
contains
(
"log4j2.xml"
);
.
contains
(
"log4j2.
properties"
,
"log4j2.
xml"
);
}
}
@Test
@Test
...
@@ -241,7 +241,8 @@ public class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
...
@@ -241,7 +241,8 @@ public class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
@Test
@Test
public
void
springConfigLocations
()
{
public
void
springConfigLocations
()
{
String
[]
locations
=
getSpringConfigLocations
(
this
.
loggingSystem
);
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
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment