Java 类org.apache.logging.log4j.core.filter.AbstractFilter 实例源码

项目:log4j-s3-search    文件:Log4j2AppenderBuilder.java   
Log4j2Appender installFilter(Log4j2Appender appender) {
    appender.addFilter(new AbstractFilter() {
        @Override
        public Result filter(final LogEvent event) {
            // To prevent infinite looping, we filter out events from
            // the publishing thread
            Result decision = Result.NEUTRAL;
            if (LoggingEventCache.PUBLISH_THREAD_NAME.equals(event.getThreadName())) {
                decision = Result.DENY;
            }
            return decision;
        }});
    return appender;
}