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

Log4j migration guide

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 {


public Logger makeNewLoggerInstance(final String name) {

return new TestLogger(name);



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 file (for log4j 1.2.8)



An implementation for flutter file storage

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