Interface AsyncAppenderAdminMBean
- All Known Implementing Classes:
AsyncAppenderAdmin
public interface AsyncAppenderAdminMBean
The MBean interface for monitoring and managing an
AsyncAppender.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns a String array with the appender refs configured for the instrumentedAsyncAppender.Returns the result of callingtoStringon the error handler of this appender, or"null"if no error handler was set.Returns the name of the appender that any errors are logged to ornull.Returns a string description of all filters configured for the instrumentedAsyncAppender.Returns the result of callingtoStringon theLayoutobject of the instrumentedAsyncAppender.getName()Returns the name of the instrumentedAsyncAppender.intintbooleanReturnstrueif this AsyncAppender will block when the queue is full, orfalseif events are dropped when the queue is full.booleanReturns how exceptions thrown on the instrumentedAsyncAppenderare handled.booleanReturnstrueif this AsyncAppender will take a snapshot of the stack with every log event to determine the class and method where the logging call was made.
-
Field Details
-
PATTERN
ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=AsyncAppenders,name=%s" ) for AsyncAppenderAdmin MBeans. This pattern contains two variables, where the first is the name of the context, the second is the name of the instrumented appender.You can find all registered AsyncAppenderAdmin MBeans like this:
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); String pattern = String.format(AsyncAppenderAdminMBean.PATTERN, "*", "*"); Set<ObjectName> appenderNames = mbs.queryNames(new ObjectName(pattern), null);
Some characters are not allowed in ObjectNames. The logger context name and appender name may be quoted. When AsyncAppenderAdmin MBeans are registered, their ObjectNames are created using this pattern as follows:
String ctxName = Server.escape(loggerContext.getName()); String appenderName = Server.escape(appender.getName()); String name = String.format(PATTERN, ctxName, appenderName); ObjectName objectName = new ObjectName(name);
- See Also:
-
-
Method Details
-
getName
String getName()Returns the name of the instrumentedAsyncAppender.- Returns:
- the name of the AsyncAppender
-
getLayout
String getLayout()Returns the result of callingtoStringon theLayoutobject of the instrumentedAsyncAppender.- Returns:
- the
Layoutof the instrumentedAsyncAppenderas a string
-
isIgnoreExceptions
boolean isIgnoreExceptions()Returns how exceptions thrown on the instrumentedAsyncAppenderare handled.- Returns:
trueif any exceptions thrown by the AsyncAppender will be logged orfalseif such exceptions are re-thrown.
-
getErrorHandler
String getErrorHandler()Returns the result of callingtoStringon the error handler of this appender, or"null"if no error handler was set.- Returns:
- result of calling
toStringon the error handler of this appender, or"null"
-
getFilter
String getFilter()Returns a string description of all filters configured for the instrumentedAsyncAppender.- Returns:
- a string description of all configured filters for this appender
-
getAppenderRefs
String[] getAppenderRefs()Returns a String array with the appender refs configured for the instrumentedAsyncAppender.- Returns:
- the appender refs for the instrumented
AsyncAppender.
-
isIncludeLocation
boolean isIncludeLocation()Returnstrueif this AsyncAppender will take a snapshot of the stack with every log event to determine the class and method where the logging call was made.- Returns:
trueif location is included with every event,falseotherwise
-
isBlocking
boolean isBlocking()Returnstrueif this AsyncAppender will block when the queue is full, orfalseif events are dropped when the queue is full.- Returns:
- whether this AsyncAppender will block or drop events when the queue is full.
-
getErrorRef
String getErrorRef()Returns the name of the appender that any errors are logged to ornull.- Returns:
- the name of the appender that any errors are logged to or
null
-
getQueueCapacity
int getQueueCapacity() -
getQueueRemainingCapacity
int getQueueRemainingCapacity()
-