I have one customer appender class that was implemented in log4j 1 as below:
import org.apache.log4j.FileAppender;
import org.apache.log4j.helpers.CountingQuietWriter;
import org.apache.log4j.helpers.LogLog;
...
public class CustomFileAppender extends FileAppender
{
...
@Override
protected void setQWForFiles(final Writer writer)
{
super.qw = new CountingQuietWriter(writer, super.errorHandler);
}
}
I'm trying to migrate this class to use bridge (log4j-1.2-api-2.17.1) (and log4j 2 core and api version 2.17.1)
I noticed that:
1> The Log4j bridge does not have FileApennder class. The migration doc did list the FileAppender as one of the supported components
2> log4j 2 File appender cannot be extend as the class is defined as "public final class FileAppender"
My questions are:
1> What is the best way to migrate custom File Appender in this case?
2> What is the equivalent of below classes in log4j2?
- org.apache.log4j.FileAppender;
- org.apache.log4j.helpers.CountingQuietWriter
- org.apache.log4j.helpers.LogLog