Support <springProfile> in logback configurations
Include support for a new <springProfile> element which can be used in `logback-spring.xml` files to selectively enable or disable parts of the configuration. For example: <configuration> ... <springProfile name="staging"> <logger name="sample.logback" level="TRACE" /> </springProfile> ... </configuration> Fixes gh-3338
This commit is contained in:
@@ -35,4 +35,12 @@ public class SampleLogbackApplicationTests {
|
||||
this.outputCapture.expect(not(containsString("Sample Trace Message")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProfile() throws Exception {
|
||||
SampleLogbackApplication
|
||||
.main(new String[] { "--spring.profiles.active=staging" });
|
||||
this.outputCapture.expect(containsString("Sample Debug Message"));
|
||||
this.outputCapture.expect(containsString("Sample Trace Message"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user