Package wt.log4j.jmx

Interface LoggerRepositoryMonitorMBean

All Superinterfaces:
SelfEmailingMBean

public interface LoggerRepositoryMonitorMBean extends SelfEmailingMBean


Supported API: true
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Type of notification produced when a log4j appender is added

    Supported API: true
    static final String
    Type of notification produced when log4j configuration is reset through this MBean

    Supported API: true
    static final String
    Type of notification produced when log4j logger level is changed through this MBean or through a LoggerMonitor MBean

    Supported API: true
    static final String
    Type of notification produced after log4j is reconfigured through this MBean

    Supported API: true
    static final String
    Type of notification produced immediately before log4j is reconfigured through this MBean

    Supported API: true
    static final String
    Type of notification produced when a log4j appender is removed

    Supported API: true
    static final String
    Type of notification produced immediately before log4j configuration is reset through this MBean

    Supported API: true
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFilter(String filterName, String filterClassname)
    Create and add a named wt.log4j.jmx.LoggingEventFilter instance to set of filters (as per the Filters attribute).
    void
    emailConfigurationFile(String addressesOrEmailList, String subject)
    E-mail the log4j configuration file

    Supported API: true
    Names of all known appenders

    Supported API: true
    int
    Interval (in seconds) at which configuration file is checked for changes

    Supported API: true
    The contents of the log4j configuration file

    Supported API: true
    Reference to configuration file (via URL, file path, or resource path), if known/provided; this attribute is externally controlled and is not persisted with this MBean

    Supported API: true
    Configuration as an absolute URL reference

    Supported API: true
    Deprecated.
    Names and classes of wt.log4j.jmx.LoggingEventFilter filter instances; when FiltersEnabled is true, these are applied to logging events prior to being handed to appenders

    Supported API: true
    getLevel(String loggerName)
    Get log level for a given logger.
    Basic configuration information on loggers registered with this logging hierarchy which have a non-default configuration

    Supported API: true
    getLoggerInfo(boolean nonDefaultOnly)
    Get basic configuration information on loggers registered with this logging hierarchy

    Supported API: true
    Names of all loggers registered with this logging hierarchy

    Supported API: true
    getMatchingLoggerNames(String matchingExpression)
    Returns the all logger names which match the given regular expression

    Supported API: true
    Verbosity level of root logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF

    Supported API: true
    Deprecated.
    boolean
    Whether wt.log4j.jmx.LoggingEventFilter instances in Filters are enabled

    Supported API: true
    boolean
    Whether loggers MBeans use hierarchically displayable names

    Supported API: true
    void
    Reapplies logging configuration when ConfigurationURL is known, else does nothing

    Supported API: true
    void
    registerLogger(String loggerName)
    Ensure set of logger management entries includes a particular existing logger, if it exists

    Supported API: true
    void
    registerLogger(String loggerName, boolean create)
    Ensure set of logger management entries includes a particular existing logger, creating the logger as necessary

    Supported API: true
    void
    Ensure set of logger management entries matches current set of loggers

    Supported API: true
    void
    registerLoggers(String matchingExpression)
    Register all loggers whose names match the given regular expression

    Supported API: true
    void
    removeFilter(String filterName)
    Remove the wt.log4j.jmx.LoggingEventFilter instance with given name from set of filters.
    void
    Resets and then reapplies logging configuration when ConfigurationURL is known, else does nothing; WARNING: this operation should be used with great caution as it resets (and does not restore) numerous settings which are applied dynamically under normal operation

    Supported API: true
    searchConfigurationFile(String searchRegexp, boolean numberLines)
    View all lines of log4j configuration file that match a specified regular expression.
    void
    sendConfigurationFileToSupport(long callNumber, String description)
    Send log4j configuration file to technical support

    Supported API: true
    void
    setConfigurationCheckInterval(int configurationCheckInterval)
    Interval (in seconds) at which configuration file is checked for changes

    Supported API: true
    void
    setConfigurationFileRef(String configurationFileRef)
    Reference to configuration file (via URL, file path, or resource path), if known/provided; this attribute is externally controlled and is not persisted with this MBean

    Supported API: true
    void
    setFiltersEnabled(boolean filtersEnabled)
    Whether wt.log4j.jmx.LoggingEventFilter instances in Filters are enabled

    Supported API: true
    void
    setHierarchicalLoggerDisplay(boolean hierarchicalLoggerDisplay)
    Whether loggers MBeans use hierarchically displayable names

    Supported API: true
    void
    setLevel(String loggerName, String level)
    Set log level for a given logger.
    void
    setRootLoggerLevel(String rootLogLevel)
    Verbosity level of root logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF

    Supported API: true
    void
    setThreshold(String threshold)
    Deprecated.
    void
    Unregister all loggers.
    View the log4j configuration file

    Supported API: true

    Methods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean

    emailThisMBean
  • Field Details

    • ADD_APPENDER_NOTIF_TYPE

      static final String ADD_APPENDER_NOTIF_TYPE
      Type of notification produced when a log4j appender is added

      Supported API: true
    • REMOVE_APPENDER_NOTIF_TYPE

      static final String REMOVE_APPENDER_NOTIF_TYPE
      Type of notification produced when a log4j appender is removed

      Supported API: true
    • RECONFIGURING_NOTIF_TYPE

      static final String RECONFIGURING_NOTIF_TYPE
      Type of notification produced immediately before log4j is reconfigured through this MBean

      Supported API: true
    • RECONFIGURED_NOTIF_TYPE

      static final String RECONFIGURED_NOTIF_TYPE
      Type of notification produced after log4j is reconfigured through this MBean

      Supported API: true
    • RESETTING_CONFIGURATION_NOTIF_TYPE

      static final String RESETTING_CONFIGURATION_NOTIF_TYPE
      Type of notification produced immediately before log4j configuration is reset through this MBean

      Supported API: true
    • CONFIGURATION_RESET_NOTIF_TYPE

      static final String CONFIGURATION_RESET_NOTIF_TYPE
      Type of notification produced when log4j configuration is reset through this MBean

      Supported API: true
    • LEVEL_CHANGED_NOTIF_TYPE

      static final String LEVEL_CHANGED_NOTIF_TYPE
      Type of notification produced when log4j logger level is changed through this MBean or through a LoggerMonitor MBean

      Supported API: true
  • Method Details

    • getConfigurationURLString

      String getConfigurationURLString()
      Configuration as an absolute URL reference

      Supported API: true
    • getConfigurationFileRef

      String getConfigurationFileRef()
      Reference to configuration file (via URL, file path, or resource path), if known/provided; this attribute is externally controlled and is not persisted with this MBean

      Supported API: true
    • setConfigurationFileRef

      void setConfigurationFileRef(String configurationFileRef) throws IOException
      Reference to configuration file (via URL, file path, or resource path), if known/provided; this attribute is externally controlled and is not persisted with this MBean

      Supported API: true
      Throws:
      IOException
    • getConfigurationFileContents

      String[] getConfigurationFileContents() throws IOException
      The contents of the log4j configuration file

      Supported API: true
      Throws:
      IOException
    • getConfigurationCheckInterval

      int getConfigurationCheckInterval()
      Interval (in seconds) at which configuration file is checked for changes

      Supported API: true
    • setConfigurationCheckInterval

      void setConfigurationCheckInterval(int configurationCheckInterval)
      Interval (in seconds) at which configuration file is checked for changes

      Supported API: true
    • isHierarchicalLoggerDisplay

      boolean isHierarchicalLoggerDisplay()
      Whether loggers MBeans use hierarchically displayable names

      Supported API: true
    • setHierarchicalLoggerDisplay

      void setHierarchicalLoggerDisplay(boolean hierarchicalLoggerDisplay)
      Whether loggers MBeans use hierarchically displayable names

      Supported API: true
    • getAppenderNames

      String[] getAppenderNames()
      Names of all known appenders

      Supported API: true
    • getLoggerNames

      String[] getLoggerNames()
      Names of all loggers registered with this logging hierarchy

      Supported API: true
    • getLoggerInfo

      TabularData getLoggerInfo() throws OpenDataException
      Basic configuration information on loggers registered with this logging hierarchy which have a non-default configuration

      Supported API: true
      Throws:
      OpenDataException
    • getLoggerInfo

      @MBeanOperationImpact(0) TabularData getLoggerInfo(boolean nonDefaultOnly) throws OpenDataException
      Get basic configuration information on loggers registered with this logging hierarchy

      Supported API: true
      Parameters:
      nonDefaultOnly - Whether results should contain only those loggers which have a non-default configuration
      Throws:
      OpenDataException
    • getThreshold

      @Deprecated String getThreshold()
      Deprecated.
      Global logging level below which log events are immediately ignored; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF

      Supported API: true
    • setThreshold

      @Deprecated void setThreshold(String threshold)
      Deprecated.
      Global logging level below which log events are immediately ignored; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF

      Supported API: true
    • getRootLoggerLevel

      String getRootLoggerLevel()
      Verbosity level of root logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF

      Supported API: true
    • setRootLoggerLevel

      void setRootLoggerLevel(String rootLogLevel)
      Verbosity level of root logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF

      Supported API: true
    • isFiltersEnabled

      boolean isFiltersEnabled()
      Whether wt.log4j.jmx.LoggingEventFilter instances in Filters are enabled

      Supported API: true
    • setFiltersEnabled

      void setFiltersEnabled(boolean filtersEnabled)
      Whether wt.log4j.jmx.LoggingEventFilter instances in Filters are enabled

      Supported API: true
    • getFilters

      TabularData getFilters() throws OpenDataException
      Names and classes of wt.log4j.jmx.LoggingEventFilter filter instances; when FiltersEnabled is true, these are applied to logging events prior to being handed to appenders

      Supported API: true
      Throws:
      OpenDataException
    • registerLoggers

      @MBeanOperationImpact(0) void registerLoggers()
      Ensure set of logger management entries matches current set of loggers

      Supported API: true
    • registerLogger

      @MBeanOperationImpact(0) void registerLogger(String loggerName)
      Ensure set of logger management entries includes a particular existing logger, if it exists

      Supported API: true
      Parameters:
      loggerName - Name of logger
    • registerLogger

      @MBeanOperationImpact(0) void registerLogger(String loggerName, boolean create)
      Ensure set of logger management entries includes a particular existing logger, creating the logger as necessary

      Supported API: true
      Parameters:
      loggerName - Name of logger
      create - Whether to create logger if it does not already exist
    • registerLoggers

      @MBeanOperationImpact(0) void registerLoggers(String matchingExpression)
      Register all loggers whose names match the given regular expression

      Supported API: true
      Parameters:
      matchingExpression - Regular expression; MBeans will be registered for all loggers whose names match this
    • unregisterLoggers

      @MBeanOperationImpact(1) void unregisterLoggers()
      Unregister all loggers.

      Supported API: true
    • getMatchingLoggerNames

      @MBeanOperationImpact(0) String[] getMatchingLoggerNames(String matchingExpression)
      Returns the all logger names which match the given regular expression

      Supported API: true
      Parameters:
      matchingExpression - Regular expression; logger names which match this will be returned
    • getEffectiveLevel

      @MBeanOperationImpact(0) @Deprecated String getEffectiveLevel(String loggerName)
      Deprecated.
      Get effective log level for a given logger.

      Supported API: true
      Parameters:
      loggerName - Name of logger
    • getLevel

      @MBeanOperationImpact(0) String getLevel(String loggerName)
      Get log level for a given logger.

      Supported API: true
      Parameters:
      loggerName - Name of logger
    • setLevel

      @MBeanOperationImpact(1) void setLevel(String loggerName, String level)
      Set log level for a given logger.

      Supported API: true
      Parameters:
      loggerName - Name of logger
      level - Level to assign logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)
    • reconfigure

      @MBeanOperationImpact(1) void reconfigure() throws IOException
      Reapplies logging configuration when ConfigurationURL is known, else does nothing

      Supported API: true
      Throws:
      IOException
    • resetAndReconfigure

      @MBeanOperationImpact(1) void resetAndReconfigure() throws IOException
      Resets and then reapplies logging configuration when ConfigurationURL is known, else does nothing; WARNING: this operation should be used with great caution as it resets (and does not restore) numerous settings which are applied dynamically under normal operation

      Supported API: true
      Throws:
      IOException
    • viewConfigurationFile

      @MBeanOperationImpact(0) String[] viewConfigurationFile() throws IOException
      View the log4j configuration file

      Supported API: true
      Throws:
      IOException
    • searchConfigurationFile

      @MBeanOperationImpact(0) String[] searchConfigurationFile(String searchRegexp, boolean numberLines) throws IOException
      View all lines of log4j configuration file that match a specified regular expression.

      Supported API: true
      Parameters:
      searchRegexp - Regular expression to search with
      numberLines - Whether resulting lines should include original line numbers
      Throws:
      IOException
    • emailConfigurationFile

      @MBeanOperationImpact(0) void emailConfigurationFile(String addressesOrEmailList, String subject) throws IOException
      E-mail the log4j configuration file

      Supported API: true
      Parameters:
      addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
      subject - Subject to give e-mail
      Throws:
      IOException
    • sendConfigurationFileToSupport

      @MBeanOperationImpact(0) void sendConfigurationFileToSupport(long callNumber, String description) throws Exception
      Send log4j configuration file to technical support

      Supported API: true
      Parameters:
      callNumber - Existing technical support call number to associate this data with
      description - Description to give data
      Throws:
      Exception
    • addFilter

      Create and add a named wt.log4j.jmx.LoggingEventFilter instance to set of filters (as per the Filters attribute). When FiltersEnabled is true, these are applied to logging events prior to being handed to appenders.

      An attempt is made to find a constructor in the specified class taking a single String argument and call this constructor passing the specified filter name. If this fails, the no-arg constructor (which must be public) is used instead and an attempt is also made to call setName(String) on the instance. An attempt is also made to call setOwnerMBean(BaseObjectNamed) on the instance, passing it this MBean, so that any interested filters can obtain this information.

      If the filter is a SelfAwareMBean, then the filter is registered as a child MBean of this MBean.

      The filter class must implement LoggingEventFilter.

      Supported API: true

      Parameters:
      filterName - Name to give filter instance
      filterClassname - Classname of filter to add; must implement wt.log4j.jmx.LoggingEventFilter
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • removeFilter

      @MBeanOperationImpact(1) void removeFilter(String filterName)
      Remove the wt.log4j.jmx.LoggingEventFilter instance with given name from set of filters. See the addFilter() operation and Filters attribute.

      Supported API: true
      Parameters:
      filterName - Name to give filter instance