ch.qos.logback.classic.jmx
Class JMXConfigurator

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by 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}.

Author:
Ceki Gülcü, Sébastien Pennec Contributor: Sebastian Davids See http://bugzilla.qos.ch/show_bug.cgi?id=35

Field Summary
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
JMXConfigurator(LoggerContext loggerContext, MBeanServer mbs, ObjectName objectName)
           
 
Method Summary
 String getLoggerEffectiveLevel(String loggerName)
           
 String getLoggerLevel(String loggerName)
           
 List<String> getLoggerList()
           
 List<String> getStatuses()
           
 boolean isResetResistant()
          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 unregistered
 void reloadByFileName(String fileName)
           
 void reloadByURL(URL url)
           
 void reloadDefaultConfiguration()
           
 void setLoggerLevel(String loggerName, String levelStr)
           
 String toString()
           
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JMXConfigurator

public JMXConfigurator(LoggerContext loggerContext,
                       MBeanServer mbs,
                       ObjectName objectName)
Method Detail

reloadDefaultConfiguration

public void reloadDefaultConfiguration()
                                throws JoranException
Specified by:
reloadDefaultConfiguration in interface JMXConfiguratorMBean
Throws:
JoranException

reloadByFileName

public void reloadByFileName(String fileName)
                      throws JoranException,
                             FileNotFoundException
Specified by:
reloadByFileName in interface JMXConfiguratorMBean
Throws:
JoranException
FileNotFoundException

reloadByURL

public void reloadByURL(URL url)
                 throws JoranException
Specified by:
reloadByURL in interface JMXConfiguratorMBean
Throws:
JoranException

setLoggerLevel

public void setLoggerLevel(String loggerName,
                           String levelStr)
Specified by:
setLoggerLevel in interface JMXConfiguratorMBean

getLoggerLevel

public String getLoggerLevel(String loggerName)
Specified by:
getLoggerLevel in interface JMXConfiguratorMBean

getLoggerEffectiveLevel

public String getLoggerEffectiveLevel(String loggerName)
Specified by:
getLoggerEffectiveLevel in interface JMXConfiguratorMBean

getLoggerList

public List<String> getLoggerList()
Specified by:
getLoggerList in interface JMXConfiguratorMBean

getStatuses

public List<String> getStatuses()
Specified by:
getStatuses in interface JMXConfiguratorMBean

onStop

public void onStop(LoggerContext context)
When the associated LoggerContext is stopped, this configurator must be unregistered

Specified by:
onStop in interface LoggerContextListener

onLevelChange

public void onLevelChange(Logger logger,
                          Level level)
Specified by:
onLevelChange in interface LoggerContextListener

onReset

public void onReset(LoggerContext context)
Specified by:
onReset in interface LoggerContextListener

isResetResistant

public boolean isResetResistant()
JMXConfigurator should not be removed subsequent to a LoggerContext reset.

Specified by:
isResetResistant in interface LoggerContextListener
Returns:

onStart

public void onStart(LoggerContext context)
Specified by:
onStart in interface LoggerContextListener

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2013 QOS.ch. All Rights Reserved.