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 class
Log4j2Watcher.Log4j2Appender
protected class
Log4j2Watcher.Log4j2Info
-
Field Summary
Fields Modifier and Type Field Description protected Log4j2Watcher.Log4j2Appender
appender
static org.apache.logging.log4j.Logger
log
-
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.Log4j2Appender
getAppender()
protected org.apache.logging.log4j.core.config.LoggerConfig
getLoggerConfig(org.apache.logging.log4j.core.LoggerContext ctx, String loggerName)
String
getName()
String
getThreshold()
long
getTimestamp(org.apache.logging.log4j.core.LogEvent event)
protected boolean
isRootLogger(String loggerName)
void
registerListener(ListenerConfig cfg)
void
setLogLevel(String loggerName, String level)
Sets the log level within this frameworkvoid
setThreshold(String level)
SolrDocument
toSolrDocument(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:
getName
in classLogWatcher<org.apache.logging.log4j.core.LogEvent>
- Returns:
- The implementation name
-
getAllLevels
public List<String> getAllLevels()
- Specified by:
getAllLevels
in 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:LogWatcher
Sets the log level within this framework- Specified by:
setLogLevel
in 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:
getAllLoggers
in classLogWatcher<org.apache.logging.log4j.core.LogEvent>
- Returns:
- all registered loggers
-
setThreshold
public void setThreshold(String level)
- Specified by:
setThreshold
in classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
getThreshold
public String getThreshold()
- Specified by:
getThreshold
in classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
getAppender
protected Log4j2Watcher.Log4j2Appender getAppender()
-
registerListener
public void registerListener(ListenerConfig cfg)
- Specified by:
registerListener
in classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
getTimestamp
public long getTimestamp(org.apache.logging.log4j.core.LogEvent event)
- Specified by:
getTimestamp
in classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
toSolrDocument
public SolrDocument toSolrDocument(org.apache.logging.log4j.core.LogEvent event)
- Specified by:
toSolrDocument
in classLogWatcher<org.apache.logging.log4j.core.LogEvent>
-
-