Search in sources :

Example 1 with AbstractAppender

use of org.apache.logging.log4j.core.appender.AbstractAppender in project logging-log4j2 by apache.

the class RewriteAppender method start.

@Override
public void start() {
    for (final AppenderRef ref : appenderRefs) {
        final String name = ref.getRef();
        final Appender appender = config.getAppender(name);
        if (appender != null) {
            final Filter filter = appender instanceof AbstractAppender ? ((AbstractAppender) appender).getFilter() : null;
            appenders.put(name, new AppenderControl(appender, ref.getLevel(), filter));
        } else {
            LOGGER.error("Appender " + ref + " cannot be located. Reference ignored");
        }
    }
    super.start();
}
Also used : AbstractAppender(org.apache.logging.log4j.core.appender.AbstractAppender) Appender(org.apache.logging.log4j.core.Appender) AppenderControl(org.apache.logging.log4j.core.config.AppenderControl) Filter(org.apache.logging.log4j.core.Filter) AbstractAppender(org.apache.logging.log4j.core.appender.AbstractAppender) AppenderRef(org.apache.logging.log4j.core.config.AppenderRef)

Aggregations

Appender (org.apache.logging.log4j.core.Appender)1 Filter (org.apache.logging.log4j.core.Filter)1 AbstractAppender (org.apache.logging.log4j.core.appender.AbstractAppender)1 AppenderControl (org.apache.logging.log4j.core.config.AppenderControl)1 AppenderRef (org.apache.logging.log4j.core.config.AppenderRef)1