Class AsyncAppenderAdmin
- java.lang.Object
-
- org.apache.logging.log4j.core.jmx.AsyncAppenderAdmin
-
- All Implemented Interfaces:
AsyncAppenderAdminMBean
public class AsyncAppenderAdmin extends java.lang.Object implements AsyncAppenderAdminMBean
Implementation of theAsyncAppenderAdminMBeaninterface.
-
-
Field Summary
Fields Modifier and Type Field Description private AsyncAppenderasyncAppenderprivate java.lang.StringcontextNameprivate javax.management.ObjectNameobjectName-
Fields inherited from interface org.apache.logging.log4j.core.jmx.AsyncAppenderAdminMBean
PATTERN
-
-
Constructor Summary
Constructors Constructor Description AsyncAppenderAdmin(java.lang.String contextName, AsyncAppender appender)Constructs a newAsyncAppenderAdminwith the specified contextName and async appender.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getAppenderRefs()Returns a String array with the appender refs configured for the instrumentedAsyncAppender.java.lang.StringgetErrorHandler()Returns the result of callingtoStringon the error handler of this appender, or"null"if no error handler was set.java.lang.StringgetErrorRef()Returns the name of the appender that any errors are logged to ornull.java.lang.StringgetFilter()Returns a string description of all filters configured for the instrumentedAsyncAppender.java.lang.StringgetLayout()Returns the result of callingtoStringon theLayoutobject of the instrumentedAsyncAppender.java.lang.StringgetName()Returns the name of the instrumentedAsyncAppender.javax.management.ObjectNamegetObjectName()Returns theObjectNameof this mbean.intgetQueueCapacity()intgetQueueRemainingCapacity()booleanisBlocking()Returnstrueif this AsyncAppender will block when the queue is full, orfalseif events are dropped when the queue is full.booleanisIgnoreExceptions()Returns how exceptions thrown on the instrumentedAsyncAppenderare handled.booleanisIncludeLocation()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.
-
-
-
Field Detail
-
contextName
private final java.lang.String contextName
-
asyncAppender
private final AsyncAppender asyncAppender
-
objectName
private final javax.management.ObjectName objectName
-
-
Constructor Detail
-
AsyncAppenderAdmin
public AsyncAppenderAdmin(java.lang.String contextName, AsyncAppender appender)Constructs a newAsyncAppenderAdminwith the specified contextName and async appender.- Parameters:
contextName- used in theObjectNamefor this mbeanappender- the instrumented object
-
-
Method Detail
-
getObjectName
public javax.management.ObjectName getObjectName()
Returns theObjectNameof this mbean.- Returns:
- the
ObjectName - See Also:
AppenderAdminMBean.PATTERN
-
getName
public java.lang.String getName()
Description copied from interface:AsyncAppenderAdminMBeanReturns the name of the instrumentedAsyncAppender.- Specified by:
getNamein interfaceAsyncAppenderAdminMBean- Returns:
- the name of the AsyncAppender
-
getLayout
public java.lang.String getLayout()
Description copied from interface:AsyncAppenderAdminMBeanReturns the result of callingtoStringon theLayoutobject of the instrumentedAsyncAppender.- Specified by:
getLayoutin interfaceAsyncAppenderAdminMBean- Returns:
- the
Layoutof the instrumentedAsyncAppenderas a string
-
isIgnoreExceptions
public boolean isIgnoreExceptions()
Description copied from interface:AsyncAppenderAdminMBeanReturns how exceptions thrown on the instrumentedAsyncAppenderare handled.- Specified by:
isIgnoreExceptionsin interfaceAsyncAppenderAdminMBean- Returns:
trueif any exceptions thrown by the AsyncAppender will be logged orfalseif such exceptions are re-thrown.
-
getErrorHandler
public java.lang.String getErrorHandler()
Description copied from interface:AsyncAppenderAdminMBeanReturns the result of callingtoStringon the error handler of this appender, or"null"if no error handler was set.- Specified by:
getErrorHandlerin interfaceAsyncAppenderAdminMBean- Returns:
- result of calling
toStringon the error handler of this appender, or"null"
-
getFilter
public java.lang.String getFilter()
Description copied from interface:AsyncAppenderAdminMBeanReturns a string description of all filters configured for the instrumentedAsyncAppender.- Specified by:
getFilterin interfaceAsyncAppenderAdminMBean- Returns:
- a string description of all configured filters for this appender
-
getAppenderRefs
public java.lang.String[] getAppenderRefs()
Description copied from interface:AsyncAppenderAdminMBeanReturns a String array with the appender refs configured for the instrumentedAsyncAppender.- Specified by:
getAppenderRefsin interfaceAsyncAppenderAdminMBean- Returns:
- the appender refs for the instrumented
AsyncAppender.
-
isIncludeLocation
public 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.- Specified by:
isIncludeLocationin interfaceAsyncAppenderAdminMBean- Returns:
trueif location is included with every event,falseotherwise
-
isBlocking
public boolean isBlocking()
Returnstrueif this AsyncAppender will block when the queue is full, orfalseif events are dropped when the queue is full.- Specified by:
isBlockingin interfaceAsyncAppenderAdminMBean- Returns:
- whether this AsyncAppender will block or drop events when the queue is full.
-
getErrorRef
public java.lang.String getErrorRef()
Returns the name of the appender that any errors are logged to ornull.- Specified by:
getErrorRefin interfaceAsyncAppenderAdminMBean- Returns:
- the name of the appender that any errors are logged to or
null
-
getQueueCapacity
public int getQueueCapacity()
- Specified by:
getQueueCapacityin interfaceAsyncAppenderAdminMBean
-
getQueueRemainingCapacity
public int getQueueRemainingCapacity()
- Specified by:
getQueueRemainingCapacityin interfaceAsyncAppenderAdminMBean
-
-