Merge branch '2.1.x'
# Conflicts: # docs/pom.xml # pom.xml # spring-cloud-commons-dependencies/pom.xml # spring-cloud-commons/pom.xml # spring-cloud-context-integration-tests/pom.xml # spring-cloud-context/pom.xml # spring-cloud-loadbalancer/pom.xml # spring-cloud-starter/pom.xml # spring-cloud-test-support/pom.xml
This commit is contained in:
@@ -18,6 +18,7 @@ package org.springframework.cloud.logging;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
@@ -33,6 +34,7 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
* @author Olga Maciaszek-Sharma
|
||||
*
|
||||
*/
|
||||
public class LoggingRebinderTests {
|
||||
@@ -71,4 +73,17 @@ public class LoggingRebinderTests {
|
||||
then(this.logger.isTraceEnabled()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void logLevelFalseResolvedToOff() {
|
||||
ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory
|
||||
.getLogger("org.springframework.cloud");
|
||||
StandardEnvironment environment = new StandardEnvironment();
|
||||
TestPropertyValues.of("logging.level.org.springframework.cloud=false")
|
||||
.applyTo(environment);
|
||||
rebinder.setEnvironment(environment);
|
||||
rebinder.onApplicationEvent(new EnvironmentChangeEvent(environment,
|
||||
Collections.singleton("logging.level.org.springframework.cloud")));
|
||||
then(Level.OFF).isEqualTo((logger.getLevel()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user