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
acfb07bd
Commit
acfb07bd
authored
Aug 03, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gh-3628' into 1.2.x
parents
d241171f
838e0ef3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+8
-1
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 @
acfb07bd
...
...
@@ -246,13 +246,20 @@ public class LoggingApplicationListener implements SmartApplicationListener {
name
=
null
;
}
level
=
environment
.
resolvePlaceholders
(
level
);
system
.
setLogLevel
(
name
,
LogLevel
.
valueOf
(
level
.
toUpperCase
()
));
system
.
setLogLevel
(
name
,
coerceLogLevel
(
level
));
}
catch
(
RuntimeException
ex
)
{
this
.
logger
.
error
(
"Cannot set level: "
+
level
+
" for '"
+
name
+
"'"
);
}
}
private
LogLevel
coerceLogLevel
(
String
level
)
{
if
(
"false"
.
equalsIgnoreCase
(
level
))
{
return
LogLevel
.
OFF
;
}
return
LogLevel
.
valueOf
(
level
.
toUpperCase
());
}
public
void
setOrder
(
int
order
)
{
this
.
order
=
order
;
}
...
...
spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java
View file @
acfb07bd
...
...
@@ -258,6 +258,18 @@ public class LoggingApplicationListenerTests {
assertThat
(
this
.
outputCapture
.
toString
(),
not
(
containsString
(
"testatfatal"
)));
}
@Test
public
void
parseLevelsMapsFalseToOff
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"logging.level.org.springframework.boot=false"
);
this
.
initializer
.
initialize
(
this
.
context
.
getEnvironment
(),
this
.
context
.
getClassLoader
());
this
.
logger
.
debug
(
"testatdebug"
);
this
.
logger
.
fatal
(
"testatfatal"
);
assertThat
(
this
.
outputCapture
.
toString
(),
not
(
containsString
(
"testatdebug"
)));
assertThat
(
this
.
outputCapture
.
toString
(),
not
(
containsString
(
"testatfatal"
)));
}
@Test
public
void
parseArgsDisabled
()
throws
Exception
{
this
.
initializer
.
setParseArgs
(
false
);
...
...
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