public class StatusLoggerAdmin extends NotificationBroadcasterSupport implements StatusListener, StatusLoggerAdminMBean
StatusLoggerAdminMBean interface.NAME, NOTIF_TYPE_DATA, NOTIF_TYPE_MESSAGE| Constructor and Description |
|---|
StatusLoggerAdmin(Executor executor)
Constructs a new
StatusLoggerAdmin with the Executor to
be used for sending Notifications asynchronously to listeners. |
| Modifier and Type | Method and Description |
|---|---|
String |
getLevel()
Returns the
StatusLogger level as a String. |
ObjectName |
getObjectName()
Returns the
ObjectName of this mbean. |
List<StatusData> |
getStatusData()
Returns a list with the most recent
StatusData objects in the
status history. |
String[] |
getStatusDataHistory()
Returns a string array with the most recent messages in the status
history.
|
Level |
getStatusLevel()
Return the Log Level that this listener wants included.
|
void |
log(StatusData data)
Called as events occur to process the StatusData.
|
void |
setLevel(String level)
Sets the
StatusLogger level to the specified value. |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationpublic StatusLoggerAdmin(Executor executor)
StatusLoggerAdmin with the Executor to
be used for sending Notifications asynchronously to listeners.executor - used to send notifications asynchronouslypublic String[] getStatusDataHistory()
StatusLoggerAdminMBean"log4j2.status.entries".getStatusDataHistory in interface StatusLoggerAdminMBeanStatusLogger.public List<StatusData> getStatusData()
StatusLoggerAdminMBeanStatusData objects in the
status history. The list has up to 200 entries by default but the length
can be configured with system property "log4j2.status.entries".
Note that the returned objects may contain Throwables from
external libraries.
JMX clients calling this method must be prepared to deal with the errors
that occur if they do not have the class definition for such
Throwables in their classpath.
getStatusData in interface StatusLoggerAdminMBeanStatusLogger.public String getLevel()
StatusLoggerAdminMBeanStatusLogger level as a String.getLevel in interface StatusLoggerAdminMBeanStatusLogger level.public Level getStatusLevel()
StatusListenergetStatusLevel in interface StatusListenerpublic void setLevel(String level)
StatusLoggerAdminMBeanStatusLogger level to the specified value.setLevel in interface StatusLoggerAdminMBeanlevel - the new StatusLogger level.public void log(StatusData data)
StatusListenerlog in interface StatusListenerdata - The StatusData for the event.public ObjectName getObjectName()
ObjectName of this mbean.ObjectNameStatusLoggerAdminMBean.NAMECopyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.