in

What to use in place of Loggerfactory while migrating from log4j1 to log4j2


Log4j migration guide

https://logging.apache.org/log4j/2.x/manual/migration.html

states that

Calls to org.apache.log4j.Logger.getLogger that accept a LoggerFactory must remove the org.apache.log4j.spi.LoggerFactory and use one of Log4j 2’s other extension mechanisms.

What are the extension mechanisms available in log4j2 and how best to migrate a method like below in log4j2

Here is the class:

class TestLoggerFactory implements LoggerFactory {

@Override

public Logger makeNewLoggerInstance(final String name) {

return new TestLogger(name);
}

}

and

public class TestLogger extends Logger
{

private static TestLoggerFactory testLoggerFactory = new TestLoggerFactory();

public static Category getInstance(String name)

{

return Logger.getLogger(name, testLoggerFactory);

}

public static Logger getLogger(String name)
{

return Logger.getLogger(name, testLoggerFactory);

}

We were using the below line in log4j.properties file (for log4j 1.2.8)

log4j.loggerFactory=com.test.TestLoggerFactory



Source: https://stackoverflow.com/questions/70722061/what-to-use-in-place-of-loggerfactory-while-migrating-from-log4j1-to-log4j2

An implementation for flutter file storage

How could I check If a zip file is corrupted in NodeJS?