Interface AsyncAppenderAdminMBean
-
- All Known Implementing Classes:
AsyncAppenderAdmin
public interface AsyncAppenderAdminMBean
The MBean interface for monitoring and managing anAsyncAppender
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String[]
getAppenderRefs()
Returns a String array with the appender refs configured for the instrumentedAsyncAppender
.String
getErrorHandler()
Returns the result of callingtoString
on the error handler of this appender, or"null"
if no error handler was set.String
getErrorRef()
Returns the name of the appender that any errors are logged to ornull
.String
getFilter()
Returns a string description of all filters configured for the instrumentedAsyncAppender
.String
getLayout()
Returns the result of callingtoString
on theLayout
object of the instrumentedAsyncAppender
.String
getName()
Returns the name of the instrumentedAsyncAppender
.int
getQueueCapacity()
int
getQueueRemainingCapacity()
boolean
isBlocking()
Returnstrue
if this AsyncAppender will block when the queue is full, orfalse
if events are dropped when the queue is full.boolean
isIgnoreExceptions()
Returns how exceptions thrown on the instrumentedAsyncAppender
are handled.boolean
isIncludeLocation()
Returnstrue
if 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 Detail
-
PATTERN
static final String 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:
Server.escape(String)
, Constant Field Values
-
-
Method Detail
-
getName
String getName()
Returns the name of the instrumentedAsyncAppender
.- Returns:
- the name of the AsyncAppender
-
getLayout
String getLayout()
Returns the result of callingtoString
on theLayout
object of the instrumentedAsyncAppender
.- Returns:
- the
Layout
of the instrumentedAsyncAppender
as a string
-
isIgnoreExceptions
boolean isIgnoreExceptions()
Returns how exceptions thrown on the instrumentedAsyncAppender
are handled.- Returns:
true
if any exceptions thrown by the AsyncAppender will be logged orfalse
if such exceptions are re-thrown.
-
getErrorHandler
String getErrorHandler()
Returns the result of callingtoString
on the error handler of this appender, or"null"
if no error handler was set.- Returns:
- result of calling
toString
on 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()
Returnstrue
if 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:
true
if location is included with every event,false
otherwise
-
isBlocking
boolean isBlocking()
Returnstrue
if this AsyncAppender will block when the queue is full, orfalse
if 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()
-
-