Class LoggerConfigAdmin
- java.lang.Object
-
- org.apache.logging.log4j.core.jmx.LoggerConfigAdmin
-
- All Implemented Interfaces:
LoggerConfigAdminMBean
public class LoggerConfigAdmin extends Object implements LoggerConfigAdminMBean
Implementation of theLoggerConfigAdminMBean
interface.
-
-
Field Summary
-
Fields inherited from interface org.apache.logging.log4j.core.jmx.LoggerConfigAdminMBean
PATTERN
-
-
Constructor Summary
Constructors Constructor Description LoggerConfigAdmin(LoggerContext loggerContext, LoggerConfig loggerConfig)
Constructs a newLoggerConfigAdmin
with the specified LoggerContext and logger config.
-
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 instrumentedLoggerConfig
.String
getFilter()
Returns a string description of all filters configured for the instrumentedLoggerConfig
.String
getLevel()
Returns theLoggerConfig
level as a String.String
getName()
Returns the name of the instrumentedLoggerConfig
.ObjectName
getObjectName()
Returns theObjectName
of this mbean.boolean
isAdditive()
Returns whether the instrumentedLoggerConfig
is additive.boolean
isIncludeLocation()
Returns whether the instrumentedLoggerConfig
is configured to include location.void
setAdditive(boolean additive)
Sets whether the instrumentedLoggerConfig
should be additive.void
setLevel(String level)
Sets theLoggerConfig
level to the specified value.
-
-
-
Constructor Detail
-
LoggerConfigAdmin
public LoggerConfigAdmin(LoggerContext loggerContext, LoggerConfig loggerConfig)
Constructs a newLoggerConfigAdmin
with the specified LoggerContext and logger config.- Parameters:
loggerContext
- used in theObjectName
for this mbeanloggerConfig
- the instrumented object
-
-
Method Detail
-
getObjectName
public ObjectName getObjectName()
Returns theObjectName
of this mbean.- Returns:
- the
ObjectName
- See Also:
LoggerConfigAdminMBean.PATTERN
-
getName
public String getName()
Description copied from interface:LoggerConfigAdminMBean
Returns the name of the instrumentedLoggerConfig
.- Specified by:
getName
in interfaceLoggerConfigAdminMBean
- Returns:
- the name of the LoggerConfig
-
getLevel
public String getLevel()
Description copied from interface:LoggerConfigAdminMBean
Returns theLoggerConfig
level as a String.- Specified by:
getLevel
in interfaceLoggerConfigAdminMBean
- Returns:
- the
LoggerConfig
level.
-
setLevel
public void setLevel(String level)
Description copied from interface:LoggerConfigAdminMBean
Sets theLoggerConfig
level to the specified value.- Specified by:
setLevel
in interfaceLoggerConfigAdminMBean
- Parameters:
level
- the newLoggerConfig
level.
-
isAdditive
public boolean isAdditive()
Description copied from interface:LoggerConfigAdminMBean
Returns whether the instrumentedLoggerConfig
is additive.- Specified by:
isAdditive
in interfaceLoggerConfigAdminMBean
- Returns:
true
if the LoggerConfig is additive,false
otherwise
-
setAdditive
public void setAdditive(boolean additive)
Description copied from interface:LoggerConfigAdminMBean
Sets whether the instrumentedLoggerConfig
should be additive.- Specified by:
setAdditive
in interfaceLoggerConfigAdminMBean
- Parameters:
additive
-true
if the instrumented LoggerConfig should be additive,false
otherwise
-
isIncludeLocation
public boolean isIncludeLocation()
Description copied from interface:LoggerConfigAdminMBean
Returns whether the instrumentedLoggerConfig
is configured to include location.- Specified by:
isIncludeLocation
in interfaceLoggerConfigAdminMBean
- Returns:
- whether location should be passed downstream
-
getFilter
public String getFilter()
Description copied from interface:LoggerConfigAdminMBean
Returns a string description of all filters configured for the instrumentedLoggerConfig
.- Specified by:
getFilter
in interfaceLoggerConfigAdminMBean
- Returns:
- a string description of all configured filters for this LoggerConfig
-
getAppenderRefs
public String[] getAppenderRefs()
Description copied from interface:LoggerConfigAdminMBean
Returns a String array with the appender refs configured for the instrumentedLoggerConfig
.- Specified by:
getAppenderRefs
in interfaceLoggerConfigAdminMBean
- Returns:
- the appender refs for the instrumented
LoggerConfig
.
-
-