Apache Solr open-source search software
SOLR-15640: Flush / Shutdown Async Loggers and LogManager after a test. (#301)
Mark Robert Miller0c8ee317fdd3
diff --git a/solr/core/src/java/org/apache/solr/util/StartupLoggingUtils.java b/solr/core/src/java/org/apache/solr/util/StartupLoggingUtils.javaindex 53f19b9fff4..c3c749d2414 100644--- a/solr/core/src/java/org/apache/solr/util/StartupLoggingUtils.java+++ b/solr/core/src/java/org/apache/solr/util/StartupLoggingUtils.java@@ -114,7 +114,7 @@ public final class StartupLoggingUtils {private static boolean isLog4jActive() {try {// Make sure we have log4j LogManager in classpath- Class.forName("org.apache.log4j.LogManager");+ Class.forName("org.apache.logging.log4j.LogManager");// Make sure that log4j is really selected as logger in slf4j - we could have LogManager in the bridge class :)return binder.getLoggerFactoryClassStr().contains("Log4jLoggerFactory");} catch (Exception e) {diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.javaindex 0cda87bf5fe..d0e754a687e 100644--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java@@ -65,17 +65,6 @@ import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;@ThreadLeakLingering(linger = 10000)public class SolrTestCase extends LuceneTestCase {- /**- * <b>DO NOT REMOVE THIS LOGGER</b>- * <p>- * For reasons that aren't 100% obvious, the existence of this logger is neccessary to ensure- * that the logging framework is properly initialized (even if concrete subclasses do not- * themselves initialize any loggers) so that the async logger threads can be properly shutdown- * on completion of the test suite- * </p>- * @see <a href="https://issues.apache.org/jira/browse/SOLR-14247">SOLR-14247</a>- * @see #afterSolrTestCase()- */private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());private static final Pattern NAMING_CONVENTION_TEST_SUFFIX = Pattern.compile("(.+\\.)([^.]+)(Test)");