Skip to content

Commit d176bfd

Browse files
fix: file log appender for debug profile (#4020)
Signed-off-by: Richard Salac <richard.salac@broadcom.com>
1 parent 289786a commit d176bfd

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

apiml-utility/src/main/java/org/zowe/apiml/product/logging/ApimlRollingFileAppender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void start() {
2929
* @return true if everything is ok, false otherwise.
3030
*/
3131
protected boolean verifyStartupParams() {
32-
String debug = System.getProperty("spring.profiles.include");
32+
String debug = System.getProperty("spring.profiles.active");
3333
if (debug == null || !debug.contains("debug")) {
3434
addInfo("The level isn't set to debug. File appender will be disabled.");
3535
return false;

apiml-utility/src/test/java/org/zowe/apiml/product/logging/ApimlRollingFileAppenderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void setUp() {
3333

3434
@Test
3535
void givenLogLevelAndWorkspaceDirectory_whenTheApplicationStarts_thenTheParamtersAreVerified() {
36-
System.setProperty("spring.profiles.include", "debug");
36+
System.setProperty("spring.profiles.active", "debug");
3737
System.setProperty("apiml.logs.location", "validLocation");
3838

3939
boolean result = underTest.verifyStartupParams();
@@ -43,7 +43,7 @@ void givenLogLevelAndWorkspaceDirectory_whenTheApplicationStarts_thenTheParamter
4343
@Test
4444
void givenNullLogLevelAndWorkspaceDirectory_whenTheApplicationStarts_thenTheLoggerDoesntStart() {
4545
System.setProperty("apiml.logs.location", "validLocation");
46-
System.setProperty("spring.profiles.include", "");
46+
System.setProperty("spring.profiles.active", "");
4747

4848
boolean result = underTest.verifyStartupParams();
4949
assertThat(result, is(false));
@@ -52,15 +52,15 @@ void givenNullLogLevelAndWorkspaceDirectory_whenTheApplicationStarts_thenTheLogg
5252
@Test
5353
void givenLogLevelAndNullWorkspaceDirectory_whenTheApplicationStarts_thenTheLoggerDoesntStart() {
5454
System.setProperty("apiml.logs.location", "");
55-
System.setProperty("spring.profiles.include", "debug");
55+
System.setProperty("spring.profiles.active", "debug");
5656

5757
boolean result = underTest.verifyStartupParams();
5858
assertThat(result, is(false));
5959
}
6060

6161
@Test
6262
void givenLogLevelAndWorkspaceDirectory_whenTheApplicationStarts_thenTheLoggerStarts() {
63-
System.setProperty("spring.profiles.include", "debug");
63+
System.setProperty("spring.profiles.active", "debug");
6464
System.setProperty("apiml.logs.location", "validLocation");
6565

6666
TimeBasedRollingPolicy<Object> tbrp = new TimeBasedRollingPolicy<>();

0 commit comments

Comments
 (0)