All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ytsaurus.spark.log4j.AsyncLoggerHelper Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package tech.ytsaurus.spark.log4j;

import java.util.Enumeration;

import org.apache.log4j.Appender;
import org.apache.log4j.AsyncAppender;
import org.apache.log4j.Logger;


//TODO Do we really need this class or we can get rid of it?
public class AsyncLoggerHelper extends AsyncAppender {
    public AsyncLoggerHelper() {
        super();
    }

    public void setAppenderFromLogger(String name) {
        Logger l = Logger.getLogger(name);

        Enumeration e = l.getAllAppenders();

        while (e.hasMoreElements()) {
            addAppender(e.nextElement());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy