Example usage for org.apache.solr.logging CircularList CircularList

List of usage examples for org.apache.solr.logging CircularList CircularList

Introduction

In this page you can find the example usage for org.apache.solr.logging CircularList CircularList.

Prototype

@SuppressWarnings("unchecked")
    public CircularList(int size) 

Source Link

Usage

From source file:org.vootoo.logging.logback.LogbackWatcher.java

License:Apache License

@Override
public void registerListener(ListenerConfig cfg) {
    if (history != null) {
        throw new IllegalStateException("History already registered");
    }//from   w w  w.  ja  v a2s.c o  m
    history = new CircularList<ILoggingEvent>(cfg.size);
    appenderBase = new LogbackEventAppender(this);
    if (cfg.threshold != null) {
        appenderBase.setThreshold(cfg.threshold);
    } else {
        appenderBase.setThreshold(ch.qos.logback.classic.Level.WARN.toString());
    }
    appenderBase.start(); //start for logging valid
    Logger log = getRootLogger(null);
    log.addAppender(appenderBase);
}