1
0

Disable Lumberjack and Log4j 1.x and document it (#182)

This PR removes Lumberjack and Log4j 1.x for the automatic logging
backend discovery procedure.

The updated procedure is documented in the guide.

This closes LOGGING-173 and LOGGING-188.
This commit is contained in:
Piotr P. Karwasz
2023-11-25 17:06:46 +01:00
committed by GitHub
parent 2a1457cb34
commit 35427e2ce7
7 changed files with 71 additions and 98 deletions

View File

@@ -19,6 +19,9 @@ package org.apache.commons.logging.log4j.log4j12;
import org.apache.commons.logging.PathableClassLoader;
import org.apache.commons.logging.PathableTestSuite;
import org.apache.commons.logging.impl.Log4JLogger;
import org.apache.commons.logging.impl.Log4jApiLogFactory;
import org.apache.commons.logging.impl.LogFactoryImpl;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -36,6 +39,8 @@ public class ApiClasspathStandardTestCase extends TestCase {
* Return the tests included in this test suite.
*/
public static Test suite() throws Exception {
// Ensure Log4JLogger is used
System.setProperty(LogFactoryImpl.LOG_PROPERTY, Log4JLogger.class.getName());
final PathableClassLoader parent = new PathableClassLoader(null);
parent.useExplicitLoader("junit.", Test.class.getClassLoader());
parent.addLogicalLib("commons-logging-api");

View File

@@ -19,6 +19,8 @@ package org.apache.commons.logging.log4j.log4j12;
import org.apache.commons.logging.PathableClassLoader;
import org.apache.commons.logging.PathableTestSuite;
import org.apache.commons.logging.impl.Log4JLogger;
import org.apache.commons.logging.impl.LogFactoryImpl;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -34,6 +36,8 @@ public class AppClasspathStandardTestCase extends TestCase {
* Return the tests included in this test suite.
*/
public static Test suite() throws Exception {
// Ensure Log4JLogger is used
System.setProperty(LogFactoryImpl.LOG_PROPERTY, Log4JLogger.class.getName());
final PathableClassLoader loader = new PathableClassLoader(null);
loader.useExplicitLoader("junit.", Test.class.getClassLoader());
loader.addLogicalLib("testclasses");

View File

@@ -19,6 +19,8 @@ package org.apache.commons.logging.log4j.log4j12;
import org.apache.commons.logging.PathableClassLoader;
import org.apache.commons.logging.PathableTestSuite;
import org.apache.commons.logging.impl.Log4JLogger;
import org.apache.commons.logging.impl.LogFactoryImpl;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -35,6 +37,8 @@ public class ChildClasspathStandardTestCase extends TestCase {
* Return the tests included in this test suite.
*/
public static Test suite() throws Exception {
// Ensure Log4JLogger is used
System.setProperty(LogFactoryImpl.LOG_PROPERTY, Log4JLogger.class.getName());
final PathableClassLoader parent = new PathableClassLoader(null);
parent.useExplicitLoader("junit.", Test.class.getClassLoader());

View File

@@ -19,6 +19,8 @@ package org.apache.commons.logging.log4j.log4j12;
import org.apache.commons.logging.PathableClassLoader;
import org.apache.commons.logging.PathableTestSuite;
import org.apache.commons.logging.impl.Log4JLogger;
import org.apache.commons.logging.impl.LogFactoryImpl;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -34,6 +36,8 @@ public class ParentClasspathStandardTestCase extends TestCase {
* Return the tests included in this test suite.
*/
public static Test suite() throws Exception {
// Ensure Log4JLogger is used
System.setProperty(LogFactoryImpl.LOG_PROPERTY, Log4JLogger.class.getName());
final PathableClassLoader parent = new PathableClassLoader(null);
parent.useExplicitLoader("junit.", Test.class.getClassLoader());
parent.addLogicalLib("commons-logging");