Package org.apache.solr.logging
Class LogWatcher<E>
java.lang.Object
org.apache.solr.logging.LogWatcher<E>
- Direct Known Subclasses:
JulWatcher,Log4j2Watcher
A Class to monitor Logging events and hold N events in memory
This is abstract so we can support both JUL and Log4j2 (and other logging platforms)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CircularList<org.apache.solr.common.SolrDocument> protected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabstract Collection<LoggerInfo> org.apache.solr.common.SolrDocumentListgetHistory(long since, AtomicBoolean found) intlongabstract StringgetName()abstract Stringstatic LogWatcher<?> newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader) Create and register a LogWatcher.abstract voidvoidreset()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 Details
-
history
-
last
protected long last
-
-
Constructor Details
-
LogWatcher
public LogWatcher()
-
-
Method Details
-
getName
- Returns:
- The implementation name
-
getAllLevels
- Returns:
- The valid level names for this framework
-
setLogLevel
Sets the log level within this framework -
getAllLoggers
- Returns:
- all registered loggers
-
setThreshold
-
getThreshold
-
add
-
getLastEvent
public long getLastEvent() -
getHistorySize
public int getHistorySize() -
getHistory
-
toSolrDocument
-
registerListener
-
reset
public void reset() -
newRegisteredLogWatcher
public 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
-