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
232c310d
Commit
232c310d
authored
Sep 22, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.2.x' into 2.3.x
parents
3adf06df
24102656
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
Log4j2FileXmlTests.java
...ringframework/boot/logging/log4j2/Log4j2FileXmlTests.java
+8
-11
Log4j2XmlTests.java
...g/springframework/boot/logging/log4j2/Log4j2XmlTests.java
+8
-9
No files found.
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4j2FileXmlTests.java
View file @
232c310d
...
@@ -18,10 +18,8 @@ package org.springframework.boot.logging.log4j2;
...
@@ -18,10 +18,8 @@ package org.springframework.boot.logging.log4j2;
import
java.io.File
;
import
java.io.File
;
import
org.apache.logging.log4j.core.config.Configuration
;
import
org.apache.logging.log4j.core.layout.PatternLayout
;
import
org.apache.logging.log4j.core.layout.PatternLayout
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.io.TempDir
;
import
org.junit.jupiter.api.io.TempDir
;
...
@@ -39,13 +37,6 @@ class Log4j2FileXmlTests extends Log4j2XmlTests {
...
@@ -39,13 +37,6 @@ class Log4j2FileXmlTests extends Log4j2XmlTests {
@TempDir
@TempDir
File
temp
;
File
temp
;
@Override
@BeforeEach
void
prepareConfiguration
()
{
System
.
setProperty
(
LoggingSystemProperties
.
LOG_FILE
,
new
File
(
this
.
temp
,
"test.log"
).
getAbsolutePath
());
super
.
prepareConfiguration
();
}
@Override
@Override
@AfterEach
@AfterEach
void
stopConfiguration
()
{
void
stopConfiguration
()
{
...
@@ -91,9 +82,15 @@ class Log4j2FileXmlTests extends Log4j2XmlTests {
...
@@ -91,9 +82,15 @@ class Log4j2FileXmlTests extends Log4j2XmlTests {
return
"log4j2-file.xml"
;
return
"log4j2-file.xml"
;
}
}
@Override
protected
void
prepareConfiguration
()
{
System
.
setProperty
(
LoggingSystemProperties
.
LOG_FILE
,
new
File
(
this
.
temp
,
"test.log"
).
getAbsolutePath
());
super
.
prepareConfiguration
();
}
private
String
fileAppenderPattern
()
{
private
String
fileAppenderPattern
()
{
Configuration
configuration
=
initializ
eConfiguration
();
prepar
eConfiguration
();
return
((
PatternLayout
)
configuration
.
getAppender
(
"File"
).
getLayout
()).
getConversionPattern
();
return
((
PatternLayout
)
this
.
configuration
.
getAppender
(
"File"
).
getLayout
()).
getConversionPattern
();
}
}
}
}
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4j2XmlTests.java
View file @
232c310d
...
@@ -25,7 +25,6 @@ import org.apache.logging.log4j.core.config.ConfigurationFactory;
...
@@ -25,7 +25,6 @@ import org.apache.logging.log4j.core.config.ConfigurationFactory;
import
org.apache.logging.log4j.core.config.ConfigurationSource
;
import
org.apache.logging.log4j.core.config.ConfigurationSource
;
import
org.apache.logging.log4j.core.layout.PatternLayout
;
import
org.apache.logging.log4j.core.layout.PatternLayout
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.logging.LoggingSystemProperties
;
import
org.springframework.boot.logging.LoggingSystemProperties
;
...
@@ -39,12 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -39,12 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
class
Log4j2XmlTests
{
class
Log4j2XmlTests
{
private
Configuration
configuration
;
protected
Configuration
configuration
;
@BeforeEach
void
prepareConfiguration
()
{
this
.
configuration
=
initializeConfiguration
();
}
@AfterEach
@AfterEach
void
stopConfiguration
()
{
void
stopConfiguration
()
{
...
@@ -96,8 +90,13 @@ class Log4j2XmlTests {
...
@@ -96,8 +90,13 @@ class Log4j2XmlTests {
}
}
private
String
consolePattern
()
{
private
String
consolePattern
()
{
Configuration
configuration
=
initializeConfiguration
();
prepareConfiguration
();
return
((
PatternLayout
)
configuration
.
getAppender
(
"Console"
).
getLayout
()).
getConversionPattern
();
return
((
PatternLayout
)
this
.
configuration
.
getAppender
(
"Console"
).
getLayout
()).
getConversionPattern
();
}
protected
void
prepareConfiguration
()
{
this
.
configuration
=
initializeConfiguration
();
this
.
configuration
.
start
();
}
}
protected
Configuration
initializeConfiguration
()
{
protected
Configuration
initializeConfiguration
()
{
...
...
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