|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.AppenderSkeleton
org.perf4j.log4j.AsyncCoalescingStatisticsAppender
public class AsyncCoalescingStatisticsAppender
This log4j Appender groups StopWatch log messages together to form GroupedTimingStatistics. At a scheduled interval the StopWatch log messages that currently exist in the buffer are pulled to create a single GroupedTimingStatistics instance that is then sent to any attached appenders.
Note that any LoggingEvents which do NOT contain StopWatch objects are discarded. Also, this appender stores logged messages in a bounded buffer before sending those messages to downstream appenders. If the buffer becomes full then subsequent logs will be discarded until the buffer has time to clear. You can access the number of discarded messages using the getNumDiscardedMessages() method.
Field Summary |
---|
Fields inherited from class org.apache.log4j.AppenderSkeleton |
---|
closed, errorHandler, headFilter, layout, name, tailFilter, threshold |
Constructor Summary | |
---|---|
AsyncCoalescingStatisticsAppender()
|
Method Summary | |
---|---|
void |
activateOptions()
|
void |
addAppender(Appender appender)
|
protected void |
append(LoggingEvent event)
|
void |
close()
|
Enumeration |
getAllAppenders()
|
Appender |
getAppender(String name)
|
String |
getDownstreamLogLevel()
The DownstreamLogLevel option gets the Level of the GroupedTimingStatistics LoggingEvent that is sent to downstream appenders. |
int |
getNumDiscardedMessages()
Returns the number of StopWatch messages that have been discarded due to the queue being full. |
int |
getQueueSize()
The QueueSize option is used to control the size of the internal queue used by this appender to store logged messages before they are sent to downstream appenders. |
long |
getTimeSlice()
The TimeSlice option represents the length of time, in milliseconds, of the window in which appended LogEvents are coalesced to a single GroupedTimingStatistics and sent to downstream appenders. |
boolean |
isAttached(Appender appender)
|
boolean |
isCreateRollupStatistics()
The CreateRollupStatistics option is used to determine whether "rollup" statistics should be created. |
protected StopWatchParser |
newStopWatchParser()
This helper method could potentially be overridden to return a different type of StopWatchParser that is used to parse the log messages send to this appender. |
void |
removeAllAppenders()
|
void |
removeAppender(Appender appender)
|
void |
removeAppender(String name)
|
boolean |
requiresLayout()
|
void |
setCreateRollupStatistics(boolean createRollupStatistics)
Sets the value of the CreateRollupStatistics option. |
void |
setDownstreamLogLevel(String downstreamLogLevel)
Sets the value of the DownstreamLogLevel option. |
void |
setQueueSize(int queueSize)
Sets the value of the QueueSize option. |
void |
setTimeSlice(long timeSlice)
Sets the value of the TimeSlice option. |
Methods inherited from class org.apache.log4j.AppenderSkeleton |
---|
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsyncCoalescingStatisticsAppender()
Method Detail |
---|
public long getTimeSlice()
public void setTimeSlice(long timeSlice)
timeSlice
- The new TimeSlice option, in milliseconds.public String getDownstreamLogLevel()
public void setDownstreamLogLevel(String downstreamLogLevel)
downstreamLogLevel
- The new DownstreamLogLevel option.public boolean isCreateRollupStatistics()
public void setCreateRollupStatistics(boolean createRollupStatistics)
createRollupStatistics
- The new CreateRollupStatistics option.public int getQueueSize()
getNumDiscardedMessages()
method.
public void setQueueSize(int queueSize)
queueSize
- The new QueueSize option.public void activateOptions()
activateOptions
in interface OptionHandler
activateOptions
in class AppenderSkeleton
public int getNumDiscardedMessages()
public void addAppender(Appender appender)
addAppender
in interface AppenderAttachable
public Enumeration getAllAppenders()
getAllAppenders
in interface AppenderAttachable
public Appender getAppender(String name)
getAppender
in interface AppenderAttachable
public boolean isAttached(Appender appender)
isAttached
in interface AppenderAttachable
public void removeAllAppenders()
removeAllAppenders
in interface AppenderAttachable
public void removeAppender(Appender appender)
removeAppender
in interface AppenderAttachable
public void removeAppender(String name)
removeAppender
in interface AppenderAttachable
protected void append(LoggingEvent event)
append
in class AppenderSkeleton
public boolean requiresLayout()
requiresLayout
in interface Appender
requiresLayout
in class AppenderSkeleton
public void close()
close
in interface Appender
close
in class AppenderSkeleton
protected StopWatchParser newStopWatchParser()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |