public interface LoggingManagementMBean
LoggingManagementMBean
interface provides methods to modify
Rhino's log configuration.Modifier and Type | Field and Description |
---|---|
static String |
MBEAN_NAME
The name of this MBean, equal to the string "Logging".
|
static String |
OBJECT_NAME
The JMX Object Name of this MBean.
|
Modifier and Type | Method and Description |
---|---|
void |
addAppenderRef(String logKey,
String appenderRef)
Adds an appender for a log key.
|
void |
createAppender(String appenderName,
String appenderClassName,
String appenderProps)
Creates a custom appender.
|
void |
createAppender(String appenderName,
String appenderClassName,
String appenderProps,
String processName)
Deprecated.
|
void |
createFileAppender(String appenderName,
String filename)
Creates a rolling log file appender.
|
void |
createFileAppender(String appenderName,
String filename,
String processName)
Deprecated.
|
void |
createFileAppender(String appenderName,
String filename,
String maxfilesize,
Integer maxbackups)
Creates a rolling log file appender.
|
void |
createFileAppender(String appenderName,
String filename,
String maxfilesize,
Integer maxbackups,
String processName)
Deprecated.
|
void |
createLogNotificationAppender(String appenderName,
String threshold)
Create a LogNotification appender.
|
void |
createSocketAppender(String appenderName,
String remoteHost,
int port)
Creates a log4j socket appender.
|
void |
createSocketAppender(String appenderName,
String remoteHost,
int port,
String processName)
Deprecated.
|
void |
createSyslogAppender(String appenderName,
String syslogHost,
String facility)
Create a syslog appender.
|
void |
createSyslogAppender(String appenderName,
String syslogHost,
String facility,
String processName)
Deprecated.
|
boolean |
getAdditivity(String logKey)
Return the additivity of a logger.
|
int |
getAlarmLogPeriod()
Returns the interval between periodic active alarm logs.
|
TabularData |
getAppenderProperties(String appenderName)
Returns the configuration properties for the given appender.
|
String[] |
getAppenderRefs(String logKey)
Returns an array of the names of all appenders referenced by a given logger.
|
String[] |
getAppenders()
Return a list of all configured appenders.
|
String |
getAppenderType(String appenderName)
Returns the appender type for the given appender.
|
boolean |
getColourConsole()
Determines whether ANSI colour sequences for log messages has been enabled.
|
String |
getCustomAppenderClassName(String appenderName)
Returns the class name for the given appender.
|
CompositeData |
getCustomAppenderInfo(String appenderName)
Returns information for the given custom appender.
|
String |
getEffectiveLogLevel(String logKey)
Return the effective (inherited) log level of a logger.
|
CompositeData |
getFileAppenderInfo(String appenderName)
Returns information for the given file appender.
|
String[] |
getLogKeys()
Returns an array of all known log keys.
|
String |
getLogLevel(String logKey)
Returns the loggers log level.
|
boolean |
getShowNDC()
Determine whether the nested diagnostic context output is currently enabled.
|
boolean |
getShowThread()
Determines whether output of thread names for log messages is enabled.
|
CompositeData |
getSocketAppenderInfo(String appenderName)
Returns information for the given socket appender.
|
CompositeData |
getSyslogAppenderInfo(String appenderName)
Returns information for the given syslog appender.
|
String |
getThreshold(String appenderName)
Returns the log filter level for the given appender,
or null if no threshold is set.
|
boolean |
isExists(String logKey)
Tests whether a logger for the given log key currently exists.
|
void |
removeAppender(String appenderName)
Deletes an appender.
|
void |
removeAppenderRef(String logKey,
String appenderRef)
Removes an appender for a log key.
|
void |
rollover(String appenderName)
Backup and truncate an existing file appender.
|
void |
rolloverAllLogFiles()
Backup and truncate all existing file appenders
|
void |
setAdditivity(String logKey,
boolean additivity)
Sets whether the log key inherits the log filter level of its parent logger.
|
void |
setAlarmLogPeriod(int period)
Sets the interval between periodic active alarm logs.
|
void |
setColourConsole(boolean colourConsole)
Enables ANSI colour sequences in log messages.
|
void |
setLogLevel(String logKey,
String level)
Set the log filter level for a log key.
|
void |
setShowNDC(boolean showNDC)
Enables output of the nested diagnostic context.
|
void |
setShowThread(boolean showThread)
Enables output of the thread name responsible for creating a log message.
|
void |
setThreshold(String appenderName,
String threshold)
Sets the log filter level for an appender.
|
static final String MBEAN_NAME
static final String OBJECT_NAME
void setLogLevel(String logKey, String level) throws com.opencloud.util.exception.ValidationException, ConfigurationException
logKey
- the log key of the log.level
- the desired log level, or null to clear a previously set log level.com.opencloud.util.exception.ValidationException
ConfigurationException
void setAdditivity(String logKey, boolean additivity) throws ConfigurationException, com.opencloud.util.exception.ValidationException
logKey
- the log key of the loggeradditivity
- set to true/enabled or false/disabledConfigurationException
com.opencloud.util.exception.ValidationException
void addAppenderRef(String logKey, String appenderRef) throws UnknownAppenderException, com.opencloud.util.exception.ValidationException, ConfigurationException
logKey
- the log key of the loggerappenderRef
- the name of the existing appenderUnknownAppenderException
com.opencloud.util.exception.ValidationException
ConfigurationException
void removeAppenderRef(String logKey, String appenderRef) throws UnknownAppenderException, ConfigurationException
logKey
- A parameterappenderRef
- A parameterUnknownAppenderException
- An exceptionConfigurationException
- An exceptionvoid createAppender(String appenderName, String appenderClassName, String appenderProps) throws ConfigurationException
appenderName
- the name this appender is referenced byappenderClassName
- the java class name which provides the loggingappenderProps
- comma separated list of name=valueConfigurationException
- An exception@Deprecated void createAppender(String appenderName, String appenderClassName, String appenderProps, String processName) throws ConfigurationException
createAppender(String, String, String)
appenderName
- the name this appender is referenced byappenderClassName
- the java class name which provides the loggingappenderProps
- comma separated list of name=valueprocessName
- This argument is ignoredConfigurationException
- An exceptionvoid removeAppender(String appenderName) throws UnknownAppenderException, ConfigurationException
appenderName
- the name of the appender to deleteUnknownAppenderException
- An exceptionConfigurationException
- An exceptionvoid setShowNDC(boolean showNDC) throws ConfigurationException
showNDC
- set to true/enabled or false/disabledConfigurationException
- An exceptionboolean getShowNDC() throws ConfigurationException
true
if the nested diagnostic context is being shown.ConfigurationException
- An exceptionvoid setShowThread(boolean showThread) throws ConfigurationException
showThread
- set to true/enabled or false/disabledConfigurationException
- An exceptionboolean getShowThread() throws ConfigurationException
true
if the thread name is being shown.ConfigurationException
- An exceptionvoid setColourConsole(boolean colourConsole) throws ConfigurationException
colourConsole
- set to true/enabled or false/disabledConfigurationException
- An exceptionboolean getColourConsole() throws ConfigurationException
true
if color is enabled.ConfigurationException
- An exceptionvoid setThreshold(String appenderName, String threshold) throws com.opencloud.util.exception.ValidationException, ConfigurationException
appenderName
- the name of the appender to referencethreshold
- the log level, or null to unset the thresholdcom.opencloud.util.exception.ValidationException
- An exceptionConfigurationException
- An exceptionvoid createFileAppender(String appenderName, String filename) throws ConfigurationException
appenderName
- the name the appender is referenced byfilename
- the target of the appenders log messagesConfigurationException
- An exception@Deprecated void createFileAppender(String appenderName, String filename, String processName) throws ConfigurationException
createFileAppender(String, String)
appenderName
- the name the appender is referenced byfilename
- the target of the appenders log messagesprocessName
- This argument is ignoredConfigurationException
- An exceptionvoid createFileAppender(String appenderName, String filename, String maxfilesize, Integer maxbackups) throws ConfigurationException
appenderName
- the name the appender is referenced byfilename
- the target of the appenders log messagesmaxfilesize
- the maximum size before rollovermaxbackups
- the maximum number of rolloversConfigurationException
- An exception@Deprecated void createFileAppender(String appenderName, String filename, String maxfilesize, Integer maxbackups, String processName) throws ConfigurationException
createFileAppender(String, String, String, Integer)
appenderName
- the name the appender is referenced byfilename
- the target of the appenders log messagesmaxfilesize
- the maximum size before rollovermaxbackups
- the maximum number of rolloversprocessName
- This argument is ignoredConfigurationException
- An exceptionvoid createSocketAppender(String appenderName, String remoteHost, int port) throws ConfigurationException
appenderName
- the name the appender is referenced byremoteHost
- the host to connect toport
- the port to connect toConfigurationException
- An exception@Deprecated void createSocketAppender(String appenderName, String remoteHost, int port, String processName) throws ConfigurationException
createSocketAppender(String, String, int)
appenderName
- the name the appender is referenced byremoteHost
- the host to connect toport
- the port to connect toprocessName
- This argument is ignoredConfigurationException
- An exceptionvoid createSyslogAppender(String appenderName, String syslogHost, String facility) throws ConfigurationException
appenderName
- the name the appender is referenced bysyslogHost
- the syslog hostfacility
- the syslog facility log message targetConfigurationException
- An exception@Deprecated void createSyslogAppender(String appenderName, String syslogHost, String facility, String processName) throws ConfigurationException
createSyslogAppender(String, String, String)
appenderName
- the name the appender is referenced bysyslogHost
- the syslog hostfacility
- the syslog facility log message targetprocessName
- This argument is ignoredConfigurationException
- An exceptionvoid createLogNotificationAppender(String appenderName, String threshold) throws ConfigurationException
appenderName
- the name the appender is referenced byConfigurationException
- An exceptionvoid rollover(String appenderName) throws UnknownAppenderException
appenderName
- the name of the appenderUnknownAppenderException
- An exceptionvoid rolloverAllLogFiles()
boolean getAdditivity(String logKey)
logKey
- the log key of the loggerString getEffectiveLogLevel(String logKey)
logKey
- the log key of the loggerString getLogLevel(String logKey)
logKey
- the log key of the loggerString[] getLogKeys()
String[] getAppenderRefs(String logKey) throws ConfigurationException
logKey
- the log key of the loggerConfigurationException
boolean isExists(String logKey)
logKey
- the log key of the loggerString[] getAppenders() throws ConfigurationException
ConfigurationException
String getAppenderType(String appenderName) throws UnknownAppenderException, ConfigurationException
AppenderType
, and is always non-null.
Further information for specific types is available via these methods:
getCustomAppenderClassName(java.lang.String)
, getFileAppenderInfo(java.lang.String)
,
getSocketAppenderInfo(java.lang.String)
, and getSyslogAppenderInfo(java.lang.String)
.appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existConfigurationException
String getCustomAppenderClassName(String appenderName) throws UnknownAppenderException, com.opencloud.util.exception.ValidationException, ConfigurationException
appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existcom.opencloud.util.exception.ValidationException
- If a validation error occurs, for example if the given appender isn't of the correct typeConfigurationException
CompositeData getCustomAppenderInfo(String appenderName) throws UnknownAppenderException, com.opencloud.util.exception.ValidationException, ConfigurationException
appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existcom.opencloud.util.exception.ValidationException
- If a validation error occurs, for example if the given appender isn't of the correct typeConfigurationException
CompositeData getFileAppenderInfo(String appenderName) throws UnknownAppenderException, com.opencloud.util.exception.ValidationException, ConfigurationException
appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existcom.opencloud.util.exception.ValidationException
- If a validation error occurs, for example if the given appender isn't of the correct typeConfigurationException
CompositeData getSocketAppenderInfo(String appenderName) throws UnknownAppenderException, com.opencloud.util.exception.ValidationException, ConfigurationException
appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existcom.opencloud.util.exception.ValidationException
- If a validation error occurs, for example if the given appender isn't of the correct typeConfigurationException
CompositeData getSyslogAppenderInfo(String appenderName) throws UnknownAppenderException, com.opencloud.util.exception.ValidationException, ConfigurationException
appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existcom.opencloud.util.exception.ValidationException
- If a validation error occurs, for example if the given appender isn't of the correct typeConfigurationException
TabularData getAppenderProperties(String appenderName) throws UnknownAppenderException, ConfigurationException
appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existConfigurationException
String getThreshold(String appenderName) throws UnknownAppenderException, ConfigurationException
appenderName
- the name of the appender to referenceUnknownAppenderException
- If the given appender doesn't existConfigurationException
void setAlarmLogPeriod(int period) throws IllegalArgumentException, ConfigurationException
period
- the interval between active alarm logging in secondsIllegalArgumentException
- If the given period is less than 0 seconds.ConfigurationException
int getAlarmLogPeriod() throws ConfigurationException
ConfigurationException