Package org.apache.solr.logging
Class LogWatcher<E>
- java.lang.Object
- 
- org.apache.solr.logging.LogWatcher<E>
 
- 
- Direct Known Subclasses:
- JulWatcher,- Log4j2Watcher
 
 public abstract class LogWatcher<E> extends Object A Class to monitor Logging events and hold N events in memoryThis is abstract so we can support both JUL and Log4j2 (and other logging platforms) 
- 
- 
Field SummaryFields Modifier and Type Field Description protected CircularList<E>historyprotected longlast
 - 
Constructor SummaryConstructors Constructor Description LogWatcher()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(E event, long timstamp)abstract List<String>getAllLevels()abstract Collection<LoggerInfo>getAllLoggers()org.apache.solr.common.SolrDocumentListgetHistory(long since, AtomicBoolean found)intgetHistorySize()longgetLastEvent()abstract StringgetName()abstract StringgetThreshold()abstract longgetTimestamp(E event)static LogWatcher<?>newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader)Create and register a LogWatcher.abstract voidregisterListener(ListenerConfig cfg)voidreset()abstract voidsetLogLevel(String category, String level)Sets the log level within this frameworkabstract voidsetThreshold(String level)abstract org.apache.solr.common.SolrDocumenttoSolrDocument(E event)
 
- 
- 
- 
Field Detail- 
historyprotected CircularList<E> history 
 - 
lastprotected long last 
 
- 
 - 
Method Detail- 
getNamepublic abstract String getName() - Returns:
- The implementation name
 
 - 
getAllLevelspublic abstract List<String> getAllLevels() - Returns:
- The valid level names for this framework
 
 - 
setLogLevelpublic abstract void setLogLevel(String category, String level) Sets the log level within this framework
 - 
getAllLoggerspublic abstract Collection<LoggerInfo> getAllLoggers() - Returns:
- all registered loggers
 
 - 
setThresholdpublic abstract void setThreshold(String level) 
 - 
getThresholdpublic abstract String getThreshold() 
 - 
addpublic void add(E event, long timstamp) 
 - 
getLastEventpublic long getLastEvent() 
 - 
getHistorySizepublic int getHistorySize() 
 - 
getHistorypublic org.apache.solr.common.SolrDocumentList getHistory(long since, AtomicBoolean found)
 - 
getTimestamppublic abstract long getTimestamp(E event) 
 - 
toSolrDocumentpublic abstract org.apache.solr.common.SolrDocument toSolrDocument(E event) 
 - 
registerListenerpublic abstract void registerListener(ListenerConfig cfg) 
 - 
resetpublic void reset() 
 - 
newRegisteredLogWatcherpublic static LogWatcher<?> newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader) Create and register a LogWatcher.JUL and Log4j watchers are supported out-of-the-box. You can register your own LogWatcher implementation via the plugins architecture - Parameters:
- config- a LogWatcherConfig object, containing the configuration for this LogWatcher.
- loader- a SolrResourceLoader, to be used to load plugin LogWatcher implementations. Can be null if
- Returns:
- a LogWatcher configured for the container's logging framework
 
 
- 
 
-