ch.qos.logback.core.Appender.clearAllFilters()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(33)

本文整理了Java中ch.qos.logback.core.Appender.clearAllFilters()方法的一些代码示例,展示了Appender.clearAllFilters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Appender.clearAllFilters()方法的具体详情如下:
包路径:ch.qos.logback.core.Appender
类名称:Appender
方法名:clearAllFilters

Appender.clearAllFilters介绍

暂无

代码示例

代码示例来源:origin: ethereum/ethereumj

/**
 * Allow only selected logger to print DEBUG events to STDOUT and FILE.
 * Other loggers are allowed to print ERRORS only.
 */
private static void addSampleLogger(final String loggerName) {
  if (CUSTOM_FILTER == null) {
    CUSTOM_FILTER = new CustomFilter();
    final LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
    Appender ca = loggerContext.getLogger("ROOT").getAppender("STDOUT");
    ca.clearAllFilters();
    ca.addFilter(CUSTOM_FILTER);
  }
  CUSTOM_FILTER.addVisibleLogger(loggerName);
}

代码示例来源:origin: skylot/jadx

private boolean process(JCommanderWrapper jcw) {
  if (printHelp) {
    jcw.printUsage();
    return false;
  }
  if (printVersion) {
    System.out.println(JadxDecompiler.getVersion());
    return false;
  }
  try {
    if (threadsCount <= 0) {
      throw new JadxException("Threads count must be positive, got: " + threadsCount);
    }
    if (verbose) {
      ch.qos.logback.classic.Logger rootLogger =
          (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
      // remove INFO ThresholdFilter
      Appender<ILoggingEvent> appender = rootLogger.getAppender("STDOUT");
      if (appender != null) {
        appender.clearAllFilters();
      }
    }
  } catch (JadxException e) {
    System.err.println("ERROR: " + e.getMessage());
    jcw.printUsage();
    return false;
  }
  return true;
}

代码示例来源:origin: caskdata/cdap

@Override
public void clearAllFilters() {
 delegate.clearAllFilters();
}

代码示例来源:origin: co.cask.cdap/cdap-watchdog

@Override
public void clearAllFilters() {
 delegate.clearAllFilters();
}

代码示例来源:origin: apache/jackrabbit-oak

public void finished() {
    if (thFilter==null) {
      // then we did not add it
      return;
    }
    List<Filter<ILoggingEvent>> filterList = appender.getCopyOfAttachedFiltersList();
    appender.clearAllFilters();
    for (Iterator<Filter<ILoggingEvent>> it = filterList.iterator(); it.hasNext();) {
      Filter<ILoggingEvent> filter = it.next();
      if (filter!=thFilter) {
        appender.addFilter(filter);
      }
    }
  }
}

相关文章