Commit d46591f1 authored by Andy Wilkinson's avatar Andy Wilkinson

Stop setting org.jboss.logging.provider when using Logback

This fix for gh-1928 to address a problemw with Log4j was to set
a system property that forces JBoss Logging to use SLF4J. This has the
unwanted side-effect of crashing Glassfish. We no longer support Log4j
so gh-1928 is no longer a concern. However, you can shoot yourself in
the foot by having Logback and Log4j2 on the classpath in that
particular order, but the latter has to be without its
log4j-slf4j-impl module. At this point you don't get any warnings or
error output at startup, but JBoss Logging uses Log4j2 while
everything else uses SLF4J and Logback. As a result, any logging
that's performed through JBoss Logging is silently lost.

Given the problems caused by setting the system property, and the
contrived nature of the arrangement that's necessary to cause a
problem when the property isn't set, this commit updates
LogbackLoggingSystem so that the system property is no longer set.

Closes gh-8669
parent abdc2390
...@@ -101,7 +101,6 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem { ...@@ -101,7 +101,6 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
} }
super.beforeInitialize(); super.beforeInitialize();
loggerContext.getTurboFilterList().add(FILTER); loggerContext.getTurboFilterList().add(FILTER);
configureJBossLoggingToUseSlf4j();
} }
@Override @Override
...@@ -208,10 +207,6 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem { ...@@ -208,10 +207,6 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
loadConfiguration(initializationContext, getSelfInitializationConfig(), null); loadConfiguration(initializationContext, getSelfInitializationConfig(), null);
} }
private void configureJBossLoggingToUseSlf4j() {
System.setProperty("org.jboss.logging.provider", "slf4j");
}
@Override @Override
public List<LoggerConfiguration> getLoggerConfigurations() { public List<LoggerConfiguration> getLoggerConfigurations() {
List<LoggerConfiguration> result = new ArrayList<>(); List<LoggerConfiguration> result = new ArrayList<>();
......
...@@ -253,12 +253,6 @@ public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests { ...@@ -253,12 +253,6 @@ public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
assertThat(output).contains("Hello debug world"); assertThat(output).contains("Hello debug world");
} }
@Test
public void jbossLoggingIsConfiguredToUseSlf4j() {
this.loggingSystem.beforeInitialize();
assertThat(System.getProperty("org.jboss.logging.provider")).isEqualTo("slf4j");
}
@Test @Test
public void bridgeHandlerLifecycle() { public void bridgeHandlerLifecycle() {
assertThat(bridgeHandlerInstalled()).isFalse(); assertThat(bridgeHandlerInstalled()).isFalse();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment