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
pull/1958/merge
Andy Wilkinson 10 years ago
commit d0f43d2e2b

@ -84,6 +84,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
public void beforeInitialize() { public void beforeInitialize() {
super.beforeInitialize(); super.beforeInitialize();
getLogger(null).getLoggerContext().getTurboFilterList().add(FILTER); getLogger(null).getLoggerContext().getTurboFilterList().add(FILTER);
configureJBossLoggingToUseSlf4j();
} }
@Override @Override
@ -120,6 +121,10 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
} }
} }
private void configureJBossLoggingToUseSlf4j() {
System.setProperty("org.jboss.logging.provider", "slf4j");
}
@Override @Override
public void setLogLevel(String loggerName, LogLevel level) { public void setLogLevel(String loggerName, LogLevel level) {
getLogger(loggerName).setLevel(LEVELS.get(level)); getLogger(loggerName).setLevel(LEVELS.get(level));

@ -34,6 +34,7 @@ import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.LoggerContext;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue;
* *
* @author Dave Syer * @author Dave Syer
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson
*/ */
public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests { public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
@ -134,4 +136,10 @@ public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
assertTrue("Wrong output:\n" + output, output.contains("Hello world")); assertTrue("Wrong output:\n" + output, output.contains("Hello world"));
} }
@Test
public void jbossLoggingIsConfiguredToUseSlf4j() {
this.loggingSystem.beforeInitialize();
assertEquals("slf4j", System.getProperty("org.jboss.logging.provider"));
}
} }

Loading…
Cancel
Save