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
JMXConfiguratorMBeanit has to be named as JMXConfigurator}.
-
-
Constructor Summary
Constructors Constructor Description JMXConfigurator(LoggerContext loggerContext, MBeanServer mbs, ObjectName objectName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLoggerEffectiveLevel(String loggerName)StringgetLoggerLevel(String loggerName)List<String>getLoggerList()List<String>getStatuses()booleanisResetResistant()JMXConfigurator should not be removed subsequent to a LoggerContext reset.voidonLevelChange(Logger logger, Level level)voidonReset(LoggerContext context)voidonStart(LoggerContext context)voidonStop(LoggerContext context)When the associated LoggerContext is stopped, this configurator must be unregisteredvoidreloadByFileName(String fileName)voidreloadByURL(URL url)voidreloadDefaultConfiguration()voidsetLoggerLevel(String loggerName, String levelStr)StringtoString()-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
-
-
-
-
Constructor Detail
-
JMXConfigurator
public JMXConfigurator(LoggerContext loggerContext, MBeanServer mbs, ObjectName objectName)
-
-
Method Detail
-
reloadDefaultConfiguration
public void reloadDefaultConfiguration() throws JoranException- Specified by:
reloadDefaultConfigurationin interfaceJMXConfiguratorMBean- Throws:
JoranException
-
reloadByFileName
public void reloadByFileName(String fileName) throws JoranException, FileNotFoundException
- Specified by:
reloadByFileNamein interfaceJMXConfiguratorMBean- Throws:
JoranExceptionFileNotFoundException
-
reloadByURL
public void reloadByURL(URL url) throws JoranException
- Specified by:
reloadByURLin interfaceJMXConfiguratorMBean- Throws:
JoranException
-
setLoggerLevel
public void setLoggerLevel(String loggerName, String levelStr)
- Specified by:
setLoggerLevelin interfaceJMXConfiguratorMBean
-
getLoggerLevel
public String getLoggerLevel(String loggerName)
- Specified by:
getLoggerLevelin interfaceJMXConfiguratorMBean
-
getLoggerEffectiveLevel
public String getLoggerEffectiveLevel(String loggerName)
- Specified by:
getLoggerEffectiveLevelin interfaceJMXConfiguratorMBean
-
getLoggerList
public List<String> getLoggerList()
- Specified by:
getLoggerListin interfaceJMXConfiguratorMBean
-
getStatuses
public List<String> getStatuses()
- Specified by:
getStatusesin interfaceJMXConfiguratorMBean
-
onStop
public void onStop(LoggerContext context)
When the associated LoggerContext is stopped, this configurator must be unregistered- Specified by:
onStopin interfaceLoggerContextListener
-
onLevelChange
public void onLevelChange(Logger logger, Level level)
- Specified by:
onLevelChangein interfaceLoggerContextListener
-
onReset
public void onReset(LoggerContext context)
- Specified by:
onResetin interfaceLoggerContextListener
-
isResetResistant
public boolean isResetResistant()
JMXConfigurator should not be removed subsequent to a LoggerContext reset.- Specified by:
isResetResistantin interfaceLoggerContextListener- Returns:
-
onStart
public void onStart(LoggerContext context)
- Specified by:
onStartin interfaceLoggerContextListener
-
-