Skip to content
Browse files
Support for replacing logback with alternate logger config (like log4j2)
Not all forks use logback, and there is an (prematurely) closed ticket
indicating that it would be valuable CASSANDRA-13212.

Also had to add 'org.w3c.dom' to the InstanceClassLoader so that
log4j2 could load it's configuration.

Patch by Jon Meredith; reviewed by David Capwell and Alex Petrov for CASSANDRA-15714.
  • Loading branch information
Jon Meredith authored and ifesdjeen committed Apr 16, 2020
1 parent d59833f commit 7ddfe52d51639817c6c5be86c0c8e317e33620eb
Showing 2 changed files with 7 additions and 10 deletions.

This file was deleted.

@@ -28,6 +28,8 @@

public interface ICluster<I extends IInstance> extends AutoCloseable
public static final String PROPERTY_PREFIX = "cassandra.test";

void startup();

I bootstrap(IInstanceConfig config);
@@ -89,16 +91,15 @@ static void setupLogging()
File root = Files.createTempDirectory("in-jvm-dtest").toFile();
String testConfPath = "test/conf/logback-dtest.xml";
Path logConfPath = Paths.get(root.getPath(), "/logback-dtest.xml");

String logConfigPropertyName = System.getProperty(PROPERTY_PREFIX + ".logConfigProperty", "logback.configurationFile");
Path testConfPath = Paths.get(System.getProperty(PROPERTY_PREFIX + ".logConfigPath", "test/conf/logback-dtest.xml"));
Path logConfPath = Paths.get(root.getPath(), testConfPath.getFileName().toString());
if (!logConfPath.toFile().exists())
Files.copy(new File(testConfPath).toPath(),
Files.copy(testConfPath, logConfPath);

System.setProperty("logback.configurationFile", "file://" + logConfPath);
System.setProperty(logConfigPropertyName, "file://" + logConfPath);
catch (IOException e)

0 comments on commit 7ddfe52

Please sign in to comment.