|
||||||||||
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.JmxAttributeStatisticsAppender
public class JmxAttributeStatisticsAppender
This appender is designed to be attached to an AsyncCoalescingStatisticsAppender
. It takes the incoming
GroupedTimingStatistics log messages and uses this data to update the value of a JMX MBean. The attributes on this
MBean can then be monitored by external tools. In addition, this class allows you to specify notification thresholds
so that a JMX notification is sent if one of the attributes falls outside an acceptable range (for example, if
the mean time for a specific value is too high).
Field Summary | |
---|---|
protected StatisticsExposingMBean |
mBean
This is the MBean that is registered with the MBeanServer |
Fields inherited from class org.apache.log4j.AppenderSkeleton |
---|
closed, errorHandler, headFilter, layout, name, tailFilter, threshold |
Constructor Summary | |
---|---|
JmxAttributeStatisticsAppender()
|
Method Summary | |
---|---|
void |
activateOptions()
|
protected void |
append(LoggingEvent event)
|
void |
close()
|
String |
getMBeanName()
The MBeanName option is used to specify the ObjectName under which the StatisticsExposingMBean in the MBeanServer. |
protected MBeanServer |
getMBeanServer()
Gets the MBeanServer that should be used to register the StatisticsExposingMBean. |
String |
getNotificationThresholds()
The NotificationThresholds option is a comma-separated list of acceptable range configurations. |
String |
getTagNamesToExpose()
The TagNamesToExpose option is a comma-separated list of the tag names whose statistics values (e.g. |
boolean |
requiresLayout()
|
void |
setMBeanName(String mBeanName)
Sets the value of the MBeanName option. |
void |
setNotificationThresholds(String notificationThresholds)
Sets the value of the NotificationThresholds option. |
void |
setTagNamesToExpose(String tagNamesToExpose)
Sets the value of the TagNamesToExpose 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 |
Field Detail |
---|
protected StatisticsExposingMBean mBean
Constructor Detail |
---|
public JmxAttributeStatisticsAppender()
Method Detail |
---|
public String getMBeanName()
public void setMBeanName(String mBeanName)
mBeanName
- The new value for the MBeanName option.public String getTagNamesToExpose()
StatisticsExposingMBean
for more details.
public void setTagNamesToExpose(String tagNamesToExpose)
tagNamesToExpose
- The new value for the TagNamesToExpose option.public String getNotificationThresholds()
The format of an acceptable range configuration is tagNameStatName(range) where range can be one of <value, >value, or minValue-maxValue. For example, suppose the TagNamesToExpose option was set to "databaseCall,fileWrite". This would cause the generated MBean to expose the following attributes:
databaseCallMean(<100),databaseCallMax(<1000),fileWriteMean(5-200),fileWriteTPS(>1)
public void setNotificationThresholds(String notificationThresholds)
notificationThresholds
- The new value for the NotificationThresholds option.public void activateOptions()
activateOptions
in interface OptionHandler
activateOptions
in class AppenderSkeleton
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 MBeanServer getMBeanServer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |