Merge branch '1.1.x'
Conflicts: spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java
This commit is contained in:
@@ -84,6 +84,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
|
||||
public void beforeInitialize() {
|
||||
super.beforeInitialize();
|
||||
getLogger(null).getLoggerContext().getTurboFilterList().add(FILTER);
|
||||
configureJBossLoggingToUseSlf4j();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,6 +121,10 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
|
||||
}
|
||||
}
|
||||
|
||||
private void configureJBossLoggingToUseSlf4j() {
|
||||
System.setProperty("org.jboss.logging.provider", "slf4j");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogLevel(String loggerName, LogLevel level) {
|
||||
getLogger(loggerName).setLevel(LEVELS.get(level));
|
||||
|
||||
@@ -34,6 +34,7 @@ import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
@@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue;
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Phillip Webb
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
|
||||
|
||||
@@ -134,4 +136,10 @@ public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
|
||||
assertTrue("Wrong output:\n" + output, output.contains("Hello world"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jbossLoggingIsConfiguredToUseSlf4j() {
|
||||
this.loggingSystem.beforeInitialize();
|
||||
assertEquals("slf4j", System.getProperty("org.jboss.logging.provider"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user