Class AsyncAppenderAdmin
- java.lang.Object
-
- org.apache.logging.log4j.core.jmx.AsyncAppenderAdmin
-
- All Implemented Interfaces:
AsyncAppenderAdminMBean
public class AsyncAppenderAdmin extends Object implements AsyncAppenderAdminMBean
Implementation of theAsyncAppenderAdminMBean
interface.
-
-
Field Summary
-
Fields inherited from interface org.apache.logging.log4j.core.jmx.AsyncAppenderAdminMBean
PATTERN
-
-
Constructor Summary
Constructors Constructor Description AsyncAppenderAdmin(String contextName, AsyncAppender appender)
Constructs a newAsyncAppenderAdmin
with the specified contextName and async appender.
-
Method Summary
All Methods Instance Methods Concrete 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
.ObjectName
getObjectName()
Returns theObjectName
of this mbean.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.
-
-
-
Constructor Detail
-
AsyncAppenderAdmin
public AsyncAppenderAdmin(String contextName, AsyncAppender appender)
Constructs a newAsyncAppenderAdmin
with the specified contextName and async appender.- Parameters:
contextName
- used in theObjectName
for this mbeanappender
- the instrumented object
-
-
Method Detail
-
getObjectName
public ObjectName getObjectName()
Returns theObjectName
of this mbean.- Returns:
- the
ObjectName
- See Also:
AppenderAdminMBean.PATTERN
-
getName
public String getName()
Description copied from interface:AsyncAppenderAdminMBean
Returns the name of the instrumentedAsyncAppender
.- Specified by:
getName
in interfaceAsyncAppenderAdminMBean
- Returns:
- the name of the AsyncAppender
-
getLayout
public String getLayout()
Description copied from interface:AsyncAppenderAdminMBean
Returns the result of callingtoString
on theLayout
object of the instrumentedAsyncAppender
.- Specified by:
getLayout
in interfaceAsyncAppenderAdminMBean
- Returns:
- the
Layout
of the instrumentedAsyncAppender
as a string
-
isIgnoreExceptions
public boolean isIgnoreExceptions()
Description copied from interface:AsyncAppenderAdminMBean
Returns how exceptions thrown on the instrumentedAsyncAppender
are handled.- Specified by:
isIgnoreExceptions
in interfaceAsyncAppenderAdminMBean
- Returns:
true
if any exceptions thrown by the AsyncAppender will be logged orfalse
if such exceptions are re-thrown.
-
getErrorHandler
public String getErrorHandler()
Description copied from interface:AsyncAppenderAdminMBean
Returns the result of callingtoString
on the error handler of this appender, or"null"
if no error handler was set.- Specified by:
getErrorHandler
in interfaceAsyncAppenderAdminMBean
- Returns:
- result of calling
toString
on the error handler of this appender, or"null"
-
getFilter
public String getFilter()
Description copied from interface:AsyncAppenderAdminMBean
Returns a string description of all filters configured for the instrumentedAsyncAppender
.- Specified by:
getFilter
in interfaceAsyncAppenderAdminMBean
- Returns:
- a string description of all configured filters for this appender
-
getAppenderRefs
public String[] getAppenderRefs()
Description copied from interface:AsyncAppenderAdminMBean
Returns a String array with the appender refs configured for the instrumentedAsyncAppender
.- Specified by:
getAppenderRefs
in interfaceAsyncAppenderAdminMBean
- Returns:
- the appender refs for the instrumented
AsyncAppender
.
-
isIncludeLocation
public 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.- Specified by:
isIncludeLocation
in interfaceAsyncAppenderAdminMBean
- Returns:
true
if location is included with every event,false
otherwise
-
isBlocking
public boolean isBlocking()
Returnstrue
if this AsyncAppender will block when the queue is full, orfalse
if events are dropped when the queue is full.- Specified by:
isBlocking
in interfaceAsyncAppenderAdminMBean
- Returns:
- whether this AsyncAppender will block or drop events when the queue is full.
-
getErrorRef
public String getErrorRef()
Returns the name of the appender that any errors are logged to ornull
.- Specified by:
getErrorRef
in interfaceAsyncAppenderAdminMBean
- Returns:
- the name of the appender that any errors are logged to or
null
-
getQueueCapacity
public int getQueueCapacity()
- Specified by:
getQueueCapacity
in interfaceAsyncAppenderAdminMBean
-
getQueueRemainingCapacity
public int getQueueRemainingCapacity()
- Specified by:
getQueueRemainingCapacity
in interfaceAsyncAppenderAdminMBean
-
-