|
||||||||||
| 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. |
String |
getStopWatchParserClassName()
The StopWatchParserClassName option is used to determine the class used to parse stop watch messages into StopWatch instances. |
long |
getTimeSlice()
The TimeSlice option represents the length of time, in milliseconds, of the window in which appended LoggingEvents 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 GenericAsyncCoalescingStatisticsAppender |
newGenericAsyncCoalescingStatisticsAppender()
Creates the new GenericAsyncCoalescingStatisticsAppender that this instance will wrap. |
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 |
setName(String name)
|
void |
setQueueSize(int queueSize)
Sets the value of the QueueSize option. |
void |
setStopWatchParserClassName(String stopWatchParserClassName)
Sets the value of the StopWatchParserClassName 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, 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 String getStopWatchParserClassName()
public void setStopWatchParserClassName(String stopWatchParserClassName)
stopWatchParserClassName - The new StopWatchParserClassName option.public void setName(String name)
setName in interface AppendersetName in class AppenderSkeletonpublic void activateOptions()
activateOptions in interface OptionHandleractivateOptions in class AppenderSkeletonpublic int getNumDiscardedMessages()
public void addAppender(Appender appender)
addAppender in interface AppenderAttachablepublic Enumeration getAllAppenders()
getAllAppenders in interface AppenderAttachablepublic Appender getAppender(String name)
getAppender in interface AppenderAttachablepublic boolean isAttached(Appender appender)
isAttached in interface AppenderAttachablepublic void removeAllAppenders()
removeAllAppenders in interface AppenderAttachablepublic void removeAppender(Appender appender)
removeAppender in interface AppenderAttachablepublic void removeAppender(String name)
removeAppender in interface AppenderAttachableprotected void append(LoggingEvent event)
append in class AppenderSkeletonpublic boolean requiresLayout()
requiresLayout in interface AppenderrequiresLayout in class AppenderSkeletonpublic void close()
close in interface Appenderclose in class AppenderSkeletonprotected GenericAsyncCoalescingStatisticsAppender newGenericAsyncCoalescingStatisticsAppender()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||