Package ch.qos.logback.classic.jmx
Class JMXConfigurator
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.classic.jmx.JMXConfigurator
- All Implemented Interfaces:
JMXConfiguratorMBean
,LoggerContextListener
,ContextAware
public class JMXConfigurator
extends ContextAwareBase
implements JMXConfiguratorMBean, LoggerContextListener
A class that provides access to logback components via JMX.
Since this class implements JMXConfiguratorMBean
it has to be
named as JMXConfigurator}.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
private static String
(package private) LoggerContext
(package private) MBeanServer
(package private) ObjectName
(package private) String
(package private) boolean
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
ConstructorsConstructorDescriptionJMXConfigurator
(LoggerContext loggerContext, MBeanServer mbs, ObjectName objectName) -
Method Summary
Modifier and TypeMethodDescription(package private) void
addStatusListener
(StatusListener statusListener) private void
getLoggerEffectiveLevel
(String loggerName) getLoggerLevel
(String loggerName) boolean
JMXConfigurator should not be removed subsequent to a LoggerContext reset.void
onLevelChange
(Logger logger, Level level) void
onReset
(LoggerContext context) void
onStart
(LoggerContext context) void
onStop
(LoggerContext context) When the associated LoggerContext is stopped, this configurator must be unregisteredprivate boolean
void
reloadByFileName
(String fileName) void
reloadByURL
(URL url) void
(package private) void
removeStatusListener
(StatusListener statusListener) void
setLoggerLevel
(String loggerName, String levelStr) private void
stop()
toString()
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Field Details
-
EMPTY
-
loggerContext
LoggerContext loggerContext -
mbs
MBeanServer mbs -
objectName
ObjectName objectName -
objectNameAsString
String objectNameAsString -
debug
boolean debug -
started
boolean started
-
-
Constructor Details
-
JMXConfigurator
-
-
Method Details
-
previouslyRegisteredListenerWithSameObjectName
private boolean previouslyRegisteredListenerWithSameObjectName() -
reloadDefaultConfiguration
- Specified by:
reloadDefaultConfiguration
in interfaceJMXConfiguratorMBean
- Throws:
JoranException
-
reloadByFileName
- Specified by:
reloadByFileName
in interfaceJMXConfiguratorMBean
- Throws:
JoranException
FileNotFoundException
-
addStatusListener
-
removeStatusListener
-
reloadByURL
- Specified by:
reloadByURL
in interfaceJMXConfiguratorMBean
- Throws:
JoranException
-
setLoggerLevel
- Specified by:
setLoggerLevel
in interfaceJMXConfiguratorMBean
-
getLoggerLevel
- Specified by:
getLoggerLevel
in interfaceJMXConfiguratorMBean
-
getLoggerEffectiveLevel
- Specified by:
getLoggerEffectiveLevel
in interfaceJMXConfiguratorMBean
-
getLoggerList
- Specified by:
getLoggerList
in interfaceJMXConfiguratorMBean
-
getStatuses
- Specified by:
getStatuses
in interfaceJMXConfiguratorMBean
-
onStop
When the associated LoggerContext is stopped, this configurator must be unregistered- Specified by:
onStop
in interfaceLoggerContextListener
-
onLevelChange
- Specified by:
onLevelChange
in interfaceLoggerContextListener
-
onReset
- Specified by:
onReset
in interfaceLoggerContextListener
-
isResetResistant
public boolean isResetResistant()JMXConfigurator should not be removed subsequent to a LoggerContext reset.- Specified by:
isResetResistant
in interfaceLoggerContextListener
- Returns:
-
clearFields
private void clearFields() -
stop
private void stop() -
onStart
- Specified by:
onStart
in interfaceLoggerContextListener
-
toString
-