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
a89139c0
Commit
a89139c0
authored
Jun 30, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow case insensitive logging.level properties
Fixes gh-3356
parent
5a1e66b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+1
-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 @
a89139c0
...
@@ -246,7 +246,7 @@ public class LoggingApplicationListener implements SmartApplicationListener {
...
@@ -246,7 +246,7 @@ public class LoggingApplicationListener implements SmartApplicationListener {
name
=
null
;
name
=
null
;
}
}
level
=
environment
.
resolvePlaceholders
(
level
);
level
=
environment
.
resolvePlaceholders
(
level
);
system
.
setLogLevel
(
name
,
LogLevel
.
valueOf
(
level
));
system
.
setLogLevel
(
name
,
LogLevel
.
valueOf
(
level
.
toUpperCase
()
));
}
}
catch
(
RuntimeException
ex
)
{
catch
(
RuntimeException
ex
)
{
this
.
logger
.
error
(
"Cannot set level: "
+
level
+
" for '"
+
name
+
"'"
);
this
.
logger
.
error
(
"Cannot set level: "
+
level
+
" for '"
+
name
+
"'"
);
...
...
spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java
View file @
a89139c0
...
@@ -210,6 +210,18 @@ public class LoggingApplicationListenerTests {
...
@@ -210,6 +210,18 @@ public class LoggingApplicationListenerTests {
assertThat
(
this
.
outputCapture
.
toString
(),
containsString
(
"testattrace"
));
assertThat
(
this
.
outputCapture
.
toString
(),
containsString
(
"testattrace"
));
}
}
@Test
public
void
parseLevelsCaseInsensitive
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"logging.level.org.springframework.boot=TrAcE"
);
this
.
initializer
.
initialize
(
this
.
context
.
getEnvironment
(),
this
.
context
.
getClassLoader
());
this
.
logger
.
debug
(
"testatdebug"
);
this
.
logger
.
trace
(
"testattrace"
);
assertThat
(
this
.
outputCapture
.
toString
(),
containsString
(
"testatdebug"
));
assertThat
(
this
.
outputCapture
.
toString
(),
containsString
(
"testattrace"
));
}
@Test
@Test
public
void
parseLevelsWithPlaceholder
()
throws
Exception
{
public
void
parseLevelsWithPlaceholder
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"foo=TRACE"
,
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"foo=TRACE"
,
...
...
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