Skip to content

Commit b09d0e1

Browse files
committed
Merge pull request #4449 from eddumelendez/gh-4445
* pr/4449: Fix springProfile with multi profiles separated by comma and whitespace
2 parents 6a32955 + bd709f3 commit b09d0e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringProfileAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public void begin(InterpretationContext ic, String name, Attributes attributes)
6767
}
6868

6969
private boolean acceptsProfiles(InterpretationContext ic, Attributes attributes) {
70-
String[] profileNames = StringUtils
71-
.commaDelimitedListToStringArray(attributes.getValue(NAME_ATTRIBUTE));
70+
String[] profileNames = StringUtils.trimArrayElements(StringUtils
71+
.commaDelimitedListToStringArray(attributes.getValue(NAME_ATTRIBUTE)));
7272
if (profileNames.length != 0) {
7373
for (String profileName : profileNames) {
7474
OptionHelper.substVars(profileName, ic, this.context);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<configuration>
33
<include resource="org/springframework/boot/logging/logback/base.xml" />
4-
<springProfile name="production,test">
4+
<springProfile name="production, test">
55
<logger name="org.springframework.boot.logging.logback" level="TRACE" />
66
</springProfile>
77
</configuration>

0 commit comments

Comments
 (0)