Package wt.log4j.jmx
Interface LoggerRepositoryMonitorMBean
- All Superinterfaces:
SelfEmailingMBean
Supported API: true
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringType of notification produced when a log4j appender is added
Supported API: truestatic final StringType of notification produced when log4j configuration is reset through this MBean
Supported API: truestatic final StringType of notification produced when log4j logger level is changed through this MBean or through a LoggerMonitor MBean
Supported API: truestatic final StringType of notification produced after log4j is reconfigured through this MBean
Supported API: truestatic final StringType of notification produced immediately before log4j is reconfigured through this MBean
Supported API: truestatic final StringType of notification produced when a log4j appender is removed
Supported API: truestatic final StringType of notification produced immediately before log4j configuration is reset through this MBean
Supported API: true -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate and add a named wt.log4j.jmx.LoggingEventFilter instance to set of filters (as per the Filters attribute).voidemailConfigurationFile(String addressesOrEmailList, String subject) E-mail the log4j configuration file
Supported API: trueString[]Names of all known appenders
Supported API: trueintInterval (in seconds) at which configuration file is checked for changes
Supported API: trueString[]The contents of the log4j configuration file
Supported API: trueReference 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: trueConfiguration as an absolute URL reference
Supported API: truegetEffectiveLevel(String loggerName) 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: trueGet log level for a given logger.Basic configuration information on loggers registered with this logging hierarchy which have a non-default configuration
Supported API: truegetLoggerInfo(boolean nonDefaultOnly) Get basic configuration information on loggers registered with this logging hierarchy
Supported API: trueString[]Names of all loggers registered with this logging hierarchy
Supported API: trueString[]getMatchingLoggerNames(String matchingExpression) Returns the all logger names which match the given regular expression
Supported API: trueVerbosity level of root logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF
Supported API: trueDeprecated.booleanWhether wt.log4j.jmx.LoggingEventFilter instances in Filters are enabled
Supported API: truebooleanWhether loggers MBeans use hierarchically displayable names
Supported API: truevoidReapplies logging configuration when ConfigurationURL is known, else does nothing
Supported API: truevoidregisterLogger(String loggerName) Ensure set of logger management entries includes a particular existing logger, if it exists
Supported API: truevoidregisterLogger(String loggerName, boolean create) Ensure set of logger management entries includes a particular existing logger, creating the logger as necessary
Supported API: truevoidEnsure set of logger management entries matches current set of loggers
Supported API: truevoidregisterLoggers(String matchingExpression) Register all loggers whose names match the given regular expression
Supported API: truevoidremoveFilter(String filterName) Remove the wt.log4j.jmx.LoggingEventFilter instance with given name from set of filters.voidResets 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: trueString[]searchConfigurationFile(String searchRegexp, boolean numberLines) View all lines of log4j configuration file that match a specified regular expression.voidsendConfigurationFileToSupport(long callNumber, String description) Send log4j configuration file to technical support
Supported API: truevoidsetConfigurationCheckInterval(int configurationCheckInterval) Interval (in seconds) at which configuration file is checked for changes
Supported API: truevoidsetConfigurationFileRef(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: truevoidsetFiltersEnabled(boolean filtersEnabled) Whether wt.log4j.jmx.LoggingEventFilter instances in Filters are enabled
Supported API: truevoidsetHierarchicalLoggerDisplay(boolean hierarchicalLoggerDisplay) Whether loggers MBeans use hierarchically displayable names
Supported API: truevoidSet log level for a given logger.voidsetRootLoggerLevel(String rootLogLevel) Verbosity level of root logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF
Supported API: truevoidsetThreshold(String threshold) Deprecated.voidUnregister all loggers.String[]View the log4j configuration file
Supported API: trueMethods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean
emailThisMBean
-
Field Details
-
ADD_APPENDER_NOTIF_TYPE
Type of notification produced when a log4j appender is added
Supported API: true -
REMOVE_APPENDER_NOTIF_TYPE
Type of notification produced when a log4j appender is removed
Supported API: true -
RECONFIGURING_NOTIF_TYPE
Type of notification produced immediately before log4j is reconfigured through this MBean
Supported API: true -
RECONFIGURED_NOTIF_TYPE
Type of notification produced after log4j is reconfigured through this MBean
Supported API: true -
RESETTING_CONFIGURATION_NOTIF_TYPE
Type of notification produced immediately before log4j configuration is reset through this MBean
Supported API: true -
CONFIGURATION_RESET_NOTIF_TYPE
Type of notification produced when log4j configuration is reset through this MBean
Supported API: true -
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
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
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
Basic configuration information on loggers registered with this logging hierarchy which have a non-default configuration
Supported API: true- Throws:
OpenDataException
-
getLoggerInfo
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.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.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
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
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
Ensure set of logger management entries matches current set of loggers
Supported API: true -
registerLogger
Ensure set of logger management entries includes a particular existing logger, if it exists
Supported API: true- Parameters:
loggerName- Name of logger
-
registerLogger
Ensure set of logger management entries includes a particular existing logger, creating the logger as necessary
Supported API: true- Parameters:
loggerName- Name of loggercreate- Whether to create logger if it does not already exist
-
registerLoggers
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
Unregister all loggers.
Supported API: true -
getMatchingLoggerNames
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
Deprecated.Get effective log level for a given logger.
Supported API: true- Parameters:
loggerName- Name of logger
-
getLevel
Get log level for a given logger.
Supported API: true- Parameters:
loggerName- Name of logger
-
setLevel
Set log level for a given logger.
Supported API: true- Parameters:
loggerName- Name of loggerlevel- Level to assign logger; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)
-
reconfigure
Reapplies logging configuration when ConfigurationURL is known, else does nothing
Supported API: true- Throws:
IOException
-
resetAndReconfigure
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
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 withnumberLines- 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 tosubject- 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 withdescription- Description to give data- Throws:
Exception
-
addFilter
@MBeanOperationImpact(1) void addFilter(String filterName, String filterClassname) throws ClassNotFoundException, InstantiationException, IllegalAccessException 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 instancefilterClassname- Classname of filter to add; must implement wt.log4j.jmx.LoggingEventFilter- Throws:
ClassNotFoundExceptionInstantiationExceptionIllegalAccessException
-
removeFilter
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
-