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
616d230e
Commit
616d230e
authored
Dec 20, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7639 from chaodhib/patch-1
* pr/7639: Broaden LoggingApplicationListener ignores
parents
f36ed673
2ea4d4b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+1
-6
LoggingApplicationListenerTests.java
...amework/boot/logging/LoggingApplicationListenerTests.java
+12
-0
No files found.
spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
View file @
616d230e
...
...
@@ -314,12 +314,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
}
private
boolean
ignoreLogConfig
(
String
logConfig
)
{
return
!
StringUtils
.
hasLength
(
logConfig
)
||
isDefaultAzureLoggingConfig
(
logConfig
);
}
private
boolean
isDefaultAzureLoggingConfig
(
String
candidate
)
{
return
candidate
.
startsWith
(
"-Djava.util.logging.config.file="
);
return
!
StringUtils
.
hasLength
(
logConfig
)
||
logConfig
.
startsWith
(
"-D"
);
}
private
void
initializeFinalLoggingLevels
(
ConfigurableEnvironment
environment
,
...
...
spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java
View file @
616d230e
...
...
@@ -162,6 +162,18 @@ public class LoggingApplicationListenerTests {
assertThat
(
new
File
(
tmpDir
()
+
"/spring.log"
).
exists
()).
isFalse
();
}
@Test
public
void
tomcatNopLoggingConfigDoesNotCauseAFailure
()
throws
Exception
{
TestPropertySourceUtils
.
addInlinedPropertiesToEnvironment
(
this
.
context
,
"logging.config: -Dnop"
);
this
.
initializer
.
initialize
(
this
.
context
.
getEnvironment
(),
this
.
context
.
getClassLoader
());
this
.
logger
.
info
(
"Hello world"
);
String
output
=
this
.
outputCapture
.
toString
().
trim
();
assertThat
(
output
).
contains
(
"Hello world"
).
doesNotContain
(
"???"
);
assertThat
(
new
File
(
tmpDir
()
+
"/spring.log"
).
exists
()).
isFalse
();
}
@Test
public
void
overrideConfigBroken
()
throws
Exception
{
TestPropertySourceUtils
.
addInlinedPropertiesToEnvironment
(
this
.
context
,
...
...
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