Package org.apache.solr.logging.log4j2
Class Log4j2Watcher
- java.lang.Object
-
- org.apache.solr.logging.LogWatcher<org.apache.logging.log4j.core.LogEvent>
-
- org.apache.solr.logging.log4j2.Log4j2Watcher
-
public class Log4j2Watcher extends LogWatcher<org.apache.logging.log4j.core.LogEvent>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classLog4j2Watcher.Log4j2Appenderprotected static classLog4j2Watcher.Log4j2Info
-
Field Summary
Fields Modifier and Type Field Description protected Log4j2Watcher.Log4j2Appenderappenderstatic org.apache.logging.log4j.Loggerlog-
Fields inherited from class org.apache.solr.logging.LogWatcher
history, last
-
-
Constructor Summary
Constructors Constructor Description Log4j2Watcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getAllLevels()Collection<LoggerInfo>getAllLoggers()protected Log4j2Watcher.Log4j2AppendergetAppender()protected org.apache.logging.log4j.core.config.LoggerConfiggetLoggerConfig(org.apache.logging.log4j.core.LoggerContext ctx, String loggerName)StringgetName()StringgetThreshold()protected booleanisRootLogger(String loggerName)voidregisterListener(ListenerConfig cfg)voidsetLogLevel(String loggerName, String level)Sets the log level within this frameworkvoidsetThreshold(String level)org.apache.solr.common.SolrDocumenttoSolrDocument(org.apache.logging.log4j.core.LogEvent event)-
Methods inherited from class org.apache.solr.logging.LogWatcher
add, getHistory, getHistorySize, getLastEvent, newRegisteredLogWatcher, reset
-
-
-
-
Field Detail
-
log
public static final org.apache.logging.log4j.Logger log
-
appender
protected Log4j2Watcher.Log4j2Appender appender
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein classLogWatcher<org.apache.logging.log4j.core.LogEvent>- Returns:
- The implementation name
-
getAllLevels
public List<String> getAllLevels()
- Specified by:
getAllLevelsin classLogWatcher<org.apache.logging.log4j.core.LogEvent>- Returns:
- The valid level names for this framework
-
setLogLevel
public void setLogLevel(String loggerName, String level)
Description copied from class:LogWatcherSets the log level within this framework- Specified by:
setLogLevelin classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
isRootLogger
protected boolean isRootLogger(String loggerName)
-
getLoggerConfig
protected org.apache.logging.log4j.core.config.LoggerConfig getLoggerConfig(org.apache.logging.log4j.core.LoggerContext ctx, String loggerName)
-
getAllLoggers
public Collection<LoggerInfo> getAllLoggers()
- Specified by:
getAllLoggersin classLogWatcher<org.apache.logging.log4j.core.LogEvent>- Returns:
- all registered loggers
-
setThreshold
public void setThreshold(String level)
- Specified by:
setThresholdin classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
getThreshold
public String getThreshold()
- Specified by:
getThresholdin classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
getAppender
protected Log4j2Watcher.Log4j2Appender getAppender()
-
registerListener
public void registerListener(ListenerConfig cfg)
- Specified by:
registerListenerin classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
toSolrDocument
public org.apache.solr.common.SolrDocument toSolrDocument(org.apache.logging.log4j.core.LogEvent event)
- Specified by:
toSolrDocumentin classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
-