Class LogMonitoringTimerTask

  • All Implemented Interfaces:
    MonitoringTimerTaskMBean, Runnable

    public class LogMonitoringTimerTask
    extends MonitoringTimerTask
    The LogMonitoringTimerTask class allows to periodically watch JMX attributes and write the corresponding values in the logging mechanism.
    • Field Detail

      • MONITORING_CONFIG_PERIOD_PROPERTY

        public static final String MONITORING_CONFIG_PERIOD_PROPERTY
        Name of property allowing to fix the scanning period for the log monitoring task in the server.

        This property can be fixed either from java launching command, or in a3servers.xml configuration file.

        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • DEFAULT_MONITORING_CONFIG_PERIOD

        public static final long DEFAULT_MONITORING_CONFIG_PERIOD
        Default value for the scanning period for the log monitoring task in the server, value is 60000L (60 seconds).
        See Also:
        MonitoringTimerTask, Constant Field Values
      • MONITORING_CONFIG_PATH_PROPERTY

        public static final 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.

        This property can be fixed either from java launching command, or in a3servers.xml configuration file.

        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • DEFAULT_MONITORING_CONFIG_PATH

        public static final 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.

        If the file does not exist the timer task is not launched.

        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • MONITORING_RESULT_LOGGER_PROPERTY

        public static final 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.

        This property can be fixed either from java launching command, or in a3servers.xml configuration file.

        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • DEFAULT_MONITORING_RESULT_LOGGER

        public static final 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.
        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • MONITORING_RESULT_LEVEL_PROPERTY

        public static final 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.

        This property can be fixed either from java launching command, or in a3servers.xml configuration file.

        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • DEFAULT_MONITORING_RESULT_LEVEL

        public static final 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.
        See Also:
        LogMonitoringTimerTask
      • MONITORING_RESULT_MESSAGE_PROPERTY

        public static final 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.

        This property can be fixed either from java launching command, or in a3servers.xml configuration file.

        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • DEFAULT_MONITORING_RESULT_MESSAGE

        public static final 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 ".
        See Also:
        LogMonitoringTimerTask, Constant Field Values
      • monitoringLogger

        Logger monitoringLogger
        Logger to write results.
      • msg

        String msg
        Message to log.
      • level

        int level
        Level of monitoring messages.
    • Constructor Detail

      • LogMonitoringTimerTask

        public LogMonitoringTimerTask​(Timer timer,
                                      long period,
                                      Properties attlist,
                                      Logger logger,
                                      String msg,
                                      int level)
        Initializes the LogMonitoringTimerTask component.
        Parameters:
        timer - Timer to use to schedule the resulting task.
        period - Period value of the resulting task
        attlist - List of JMX attributes to periodically watch.
        logger - Logger to write results.
        msg - Message to log.
        level - Level of monitoring messages.
      • LogMonitoringTimerTask

        public LogMonitoringTimerTask()
        Instantiates the LogMonitoringTimerTask component.
    • Method Detail

      • init

        public void init​(Timer timer,
                         long period,
                         Properties attlist,
                         Properties taskProps)
        Initializes the LogMonitoringTimerTask component.
        Specified by:
        init in class MonitoringTimerTask
        Parameters:
        timer - The timer to use to schedule the resulting task.
        period - Period value of the resulting task
        attlist - List of JMX attributes to periodically watch.
        taskProps - The properties to initialize the task.
      • addRecord

        protected void addRecord​(String mbean,
                                 String att,
                                 Object value)
        Records information about the specified attribute.
        Specified by:
        addRecord in class MonitoringTimerTask
        Parameters:
        mbean - The name of the related mbean.
        att - The name of the related attribute.
        value - The value of the related attribute.
      • getLevel

        protected int getLevel​(String levelName)
        Return the int value of the String BasicLevel
        Parameters:
        levelName - The name of the BasicLevel
        Returns:
        the int value of the String BasicLevel.