Java 类ch.qos.logback.classic.spi.TurboFilterList 实例源码

项目:scylla-tools-java    文件:AggregationTest.java   
private static void configureLogbackScanPeriod(long millis)
{
    Logger l = LoggerFactory.getLogger(AggregationTest.class);
    ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) l;
    LoggerContext ctx = logbackLogger.getLoggerContext();
    TurboFilterList turboFilterList = ctx.getTurboFilterList();
    boolean done = false;
    for (TurboFilter turboFilter : turboFilterList)
    {
        if (turboFilter instanceof ReconfigureOnChangeFilter)
        {
            ReconfigureOnChangeFilter reconfigureFilter = (ReconfigureOnChangeFilter) turboFilter;
            reconfigureFilter.setRefreshPeriod(millis);
            reconfigureFilter.stop();
            reconfigureFilter.start(); // start() sets the next check timestammp
            done = true;
            break;
        }
    }
    assertTrue("ReconfigureOnChangeFilter not in logback's turbo-filter list - do that by adding scan=\"true\" to logback-test.xml's configuration element", done);
}
项目:bartleby    文件:LoggerContext.java   
public TurboFilterList getTurboFilterList() {
  return turboFilterList;
}
项目:bartleby    文件:ReconfigureOnChangeTest.java   
private TurboFilter getFirstTurboFilter() {
  TurboFilterList turboFilterList = loggerContext.getTurboFilterList();
  return turboFilterList.get(0);
}