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

liquibase.logging.core.CompositeLogger Maven / Gradle / Ivy

The newest version!
package liquibase.logging.core;

import liquibase.logging.LogMessageFilter;
import liquibase.logging.Logger;

import java.util.List;
import java.util.logging.Level;

public class CompositeLogger extends AbstractLogger {

    private final List loggers;

    /**
     * @deprecated use {@link #CompositeLogger(List)}
     */
    public CompositeLogger(List loggers, LogMessageFilter filter) {
        this(loggers);
    }

    public CompositeLogger(List loggers) {
        this.loggers = loggers;
    }

    @Override
    public void close() throws Exception {
        for (Logger logger : loggers) {
            logger.close();
        }
    }

    @Override
    public void log(Level level, String message, Throwable e) {
        if (level == Level.OFF) {
            return;
        }

        for (Logger logger : loggers) {
            logger.log(level, message, e);
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy