Package org.ametys.runtime.log
Class MemoryAppender
java.lang.Object
org.apache.log4j.AppenderSkeleton
org.ametys.runtime.log.MemoryAppender
- All Implemented Interfaces:
Appender
,OptionHandler
Log appender that stores a pile of logs in memory.
-
Field Summary
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
append
(LoggingEvent event) void
close()
getEvents
(long fromTimestamp) Get the logs from a given timestampGet the logs from a given timestamp and filtered by specific categoriesvoid
removeExpiredEvents
(long from) Remove the expired log records every 10 secondsboolean
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
-
Constructor Details
-
MemoryAppender
public MemoryAppender()Default constructor for the memory appender
-
-
Method Details
-
append
- Specified by:
append
in classAppenderSkeleton
-
getEvents
Get the logs from a given timestamp- Parameters:
fromTimestamp
- If greater than 0, get the events more recent than this timestamp parameter. If equals or less than 0, returns all events- Returns:
- The log events
-
getEvents
Get the logs from a given timestamp and filtered by specific categories- Parameters:
fromTimestamp
- If greater than 0, get the events more recent than this timestamp parameter. If equals or less than 0, returns all eventsfilterCategories
- The filter categories- Returns:
- The log events
-
removeExpiredEvents
Remove the expired log records every 10 seconds- Parameters:
from
- The expiration date in milliseconds
-
requiresLayout
-
close
-