public class LogMonitoringTimerTask extends MonitoringTimerTask
LogMonitoringTimerTask
class allows to periodically watch JMX attributes
and write the corresponding values in the logging mechanism.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MONITORING_CONFIG_PATH
Default value for the pathname of a configuration file for a log monitoring
task in the server, value is
logMonitoring.props . |
static long |
DEFAULT_MONITORING_CONFIG_PERIOD
Default value for the scanning period for the log monitoring task in the
server, value is
60000L (60 seconds). |
static int |
DEFAULT_MONITORING_RESULT_LEVEL
Default value for the logging level of the results for the log monitoring task
in the server, value is
WARN . |
static String |
DEFAULT_MONITORING_RESULT_LOGGER
Default value for the logger name of the results for the log monitoring task
in the server, value is
fr.dyade.aaa.agent.Monitoring . |
static String |
DEFAULT_MONITORING_RESULT_MESSAGE
Default value for the logging message of the results for the log monitoring task
in the server, value is
"JMX Monitoring " . |
(package private) int |
level
Level of monitoring messages.
|
static String |
MONITORING_CONFIG_PATH_PROPERTY
Name of property allowing to fix the pathname of a configuration file for a
log monitoring task in the server.
|
static String |
MONITORING_CONFIG_PERIOD_PROPERTY
Name of property allowing to fix the scanning period for the log monitoring
task in the server.
|
static String |
MONITORING_RESULT_LEVEL_PROPERTY
Name of property allowing to fix the logging level of the results for the
log monitoring task in the server.
|
static String |
MONITORING_RESULT_LOGGER_PROPERTY
Name of property allowing to fix the logger name of the results for the
log monitoring task in the server.
|
static String |
MONITORING_RESULT_MESSAGE_PROPERTY
Name of property allowing to set the logging message of the results for the
log monitoring task in the server.
|
(package private) org.objectweb.util.monolog.api.Logger |
monitoringLogger
Logger to write results.
|
(package private) String |
msg
Message to log.
|
(package private) StringBuffer |
strbuf |
attlist, logger, MBean_name, period
Constructor and Description |
---|
LogMonitoringTimerTask()
Instantiates the
LogMonitoringTimerTask component. |
LogMonitoringTimerTask(Timer timer,
long period,
Properties attlist,
org.objectweb.util.monolog.api.Logger logger,
String msg,
int level)
Initializes the
LogMonitoringTimerTask component. |
Modifier and Type | Method and Description |
---|---|
protected void |
addRecord(String mbean,
String att,
Object value)
Records information about the specified attribute.
|
protected void |
finalizeRecords()
Finalize the record for the current time.
|
protected int |
getLevel(String levelName)
Return the int value of the String BasicLevel
|
void |
init(Timer timer,
long period,
Properties attlist,
Properties taskProps)
Initializes the
LogMonitoringTimerTask component. |
protected void |
initializeRecords()
Initialize the record for the current collect time.
|
addMonitoredAttributes, cancelTask, delMonitoredAttributes, getMonitoredAttributes, getPeriod, run, start
cancel, scheduledExecutionTime
public static final String MONITORING_CONFIG_PERIOD_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
LogMonitoringTimerTask
,
Constant Field Valuespublic static final long DEFAULT_MONITORING_CONFIG_PERIOD
60000L
(60 seconds).MonitoringTimerTask
,
Constant Field Valuespublic static final String MONITORING_CONFIG_PATH_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
LogMonitoringTimerTask
,
Constant Field Valuespublic static final String DEFAULT_MONITORING_CONFIG_PATH
logMonitoring.props
.
If the file does not exist the timer task is not launched.
LogMonitoringTimerTask
,
Constant Field Valuespublic static final String MONITORING_RESULT_LOGGER_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
LogMonitoringTimerTask
,
Constant Field Valuespublic static final String DEFAULT_MONITORING_RESULT_LOGGER
fr.dyade.aaa.agent.Monitoring
.LogMonitoringTimerTask
,
Constant Field Valuespublic static final String MONITORING_RESULT_LEVEL_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
LogMonitoringTimerTask
,
Constant Field Valuespublic static final int DEFAULT_MONITORING_RESULT_LEVEL
WARN
.LogMonitoringTimerTask
public static final String MONITORING_RESULT_MESSAGE_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
LogMonitoringTimerTask
,
Constant Field Valuespublic static final String DEFAULT_MONITORING_RESULT_MESSAGE
"JMX Monitoring "
.LogMonitoringTimerTask
,
Constant Field Valuesorg.objectweb.util.monolog.api.Logger monitoringLogger
String msg
int level
StringBuffer strbuf
public LogMonitoringTimerTask(Timer timer, long period, Properties attlist, org.objectweb.util.monolog.api.Logger logger, String msg, int level)
LogMonitoringTimerTask
component.timer
- Timer to use to schedule the resulting task.period
- Period value of the resulting taskattlist
- List of JMX attributes to periodically watch.logger
- Logger to write results.msg
- Message to log.level
- Level of monitoring messages.public LogMonitoringTimerTask()
LogMonitoringTimerTask
component.public void init(Timer timer, long period, Properties attlist, Properties taskProps)
LogMonitoringTimerTask
component.init
in class MonitoringTimerTask
timer
- The timer to use to schedule the resulting task.period
- Period value of the resulting taskattlist
- List of JMX attributes to periodically watch.taskProps
- The properties to initialize the task.protected void initializeRecords()
initializeRecords
in class MonitoringTimerTask
MonitoringTimerTask.initializeRecords()
protected void addRecord(String mbean, String att, Object value)
addRecord
in class MonitoringTimerTask
mbean
- The name of the related mbean.att
- The name of the related attribute.value
- The value of the related attribute.protected void finalizeRecords()
finalizeRecords
in class MonitoringTimerTask
MonitoringTimerTask.finalizeRecords()
protected int getLevel(String levelName)
levelName
- The name of the BasicLevelCopyright © 2021 ScalAgent D.T.. All rights reserved.