public class Log4jLogQuery extends LogQuerySupport implements Log4jLogQueryMBean
mapper
Constructor and Description |
---|
Log4jLogQuery() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendMavenCoordinates(org.apache.log4j.spi.LoggingEvent loggingEvent) |
protected String |
filterLogEvents(LogFilter filter) |
protected LogResults |
filterLogResults(Predicate<LogEvent> predicate,
int maxCount) |
protected Properties |
getDefaultProperties() |
LruList<org.apache.log4j.spi.LoggingEvent> |
getEvents() |
LogResults |
getLogResults(int maxCount)
Returns the recent log events as a
LogResults object which is then serialized |
Properties |
getProperties() |
int |
getSize() |
boolean |
isAddMavenCoordinates() |
protected String |
loadCoords(String coords,
String filePath,
String classifier) |
void |
logMessage(org.apache.log4j.spi.LoggingEvent record) |
LogResults |
queryLogResults(LogFilter filter)
Queries the log results using the given filter
|
void |
reconnectAppender()
Provides a hook you can call if the underlying log4j
configuration is reloaded so that you can force the appender
to get re-registered.
|
void |
setAddMavenCoordinates(boolean addMavenCoordinates) |
void |
setEvents(LruList<org.apache.log4j.spi.LoggingEvent> events) |
void |
setProperties(Properties properties) |
void |
setSize(int size) |
void |
start()
Registers the object with JMX
|
void |
stop()
Unregisters the object with JMX
|
protected LogEvent |
toLogEvent(org.apache.log4j.spi.LoggingEvent element) |
addJarEntryToIndex, allLogResults, ensureStartsWithSlash, filterLogEvents, getArtifactFile, getHostName, getJavaDoc, getLogEvents, getMbeanName, getMbeanServer, getSource, isRoot, jarIndex, jarIndex, jarIndex, jsonQueryLogResults, jsonToLogFilter, loadString, logResultsSince, registerMBeanServer, setHostName, setMbeanName, setMbeanServer, toJSON, unregisterMBeanServer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allLogResults, filterLogEvents, getJavaDoc, getLogEvents, getSource, jsonQueryLogResults, logResultsSince
public void start()
LogQuerySupport
start
in class LogQuerySupport
public void reconnectAppender()
Log4jLogQueryMBean
reconnectAppender
in interface Log4jLogQueryMBean
public void stop()
LogQuerySupport
stop
in class LogQuerySupport
public LogResults getLogResults(int maxCount) throws IOException
LogQuerySupportMBean
LogResults
object which is then serializedgetLogResults
in interface LogQuerySupportMBean
maxCount
- maximum number to return o <0 for all of themIOException
public LogResults queryLogResults(LogFilter filter)
LogQuerySupportMBean
queryLogResults
in interface LogQuerySupportMBean
filter
- the filter to apply to the logsprotected LogResults filterLogResults(Predicate<LogEvent> predicate, int maxCount)
protected LogEvent toLogEvent(org.apache.log4j.spi.LoggingEvent element)
protected String filterLogEvents(LogFilter filter) throws IOException
IOException
protected void appendMavenCoordinates(org.apache.log4j.spi.LoggingEvent loggingEvent)
protected String loadCoords(String coords, String filePath, String classifier) throws IOException
loadCoords
in class LogQuerySupport
IOException
protected Properties getDefaultProperties()
public LruList<org.apache.log4j.spi.LoggingEvent> getEvents()
public void setEvents(LruList<org.apache.log4j.spi.LoggingEvent> events)
public int getSize()
public void setSize(int size)
public boolean isAddMavenCoordinates()
public void setAddMavenCoordinates(boolean addMavenCoordinates)
public Properties getProperties()
public void setProperties(Properties properties)
public void logMessage(org.apache.log4j.spi.LoggingEvent record)
logMessage
in interface Log4jLogQueryMBean
Copyright © 2021 JBoss by Red Hat. All rights reserved.