Interface LogAnalyzer


  • @Taxonomy(stability=EXPERIMENTAL)
    public interface LogAnalyzer
    Provides summary information about important logging events. PRELIMINARY--SUBJECT TO CHANGES/ADDITIONS
    Since:
    AS 9.0
    • Method Detail

      • getErrorInfo

        @ManagedAttribute
        Map<String,​Number>[] getErrorInfo()
        Get a summary of the Level.SEVERE and Level.WARNING log entries for the known history. Each entry in the resulting array is a Map with the following keys: The entries are arranged from oldest to newest with the last entry being the most recent.

        The timestamp obtained from each Map may be used as the timestamp when calling getErrorDistribution(long, java.lang.String). For example:
        final Map[] infos = logging.getErrorInfo();
        for( int i = 0; i < infos.length; ++i ) {
        final Map info = infos[ i ];
        final long timestamp = ((Long)info.get( TIMESTAMP_KEY )).longValue();

        Map counts = getErrorDistribution( timestamp );
        }

        Returns:
        Map
      • getErrorDistribution

        @ManagedOperation
        Map<String,​Integer> getErrorDistribution​(@Param(name="timestamp")
                                                       long timestamp,
                                                       @Param(name="level")
                                                       String level)
        Get the number of log entries for a particular timestamp of a particular Level for all modules. SEVERE and WARNING are the only levels supported.

        The resulting Map is keyed by the module ID, which may be any of the values found in LogModuleNames or any valid Logger name. The corresponding value is the count for that module of the requested level.

        Parameters:
        timestamp - a timestamp as obtained using TIME_STAMP_KEY from one of the Maps returned by getErrorInfo(). Note that it is a 'long' not a 'Long' and is required.
        level -
        Returns:
        Map
      • setKeepErrorStatisticsForIntervals

        @ManagedAttribute
        void setKeepErrorStatisticsForIntervals​(@Param(name="numIntervals")
                                                int numIntervals)
        Set the number of intervals error statistics should be maintained.
        Parameters:
        numIntervals - number of intervals
      • getKeepErrorStatisticsForIntervals

        @ManagedAttribute
        int getKeepErrorStatisticsForIntervals()
      • setErrorStatisticsIntervalMinutes

        @ManagedAttribute
        void setErrorStatisticsIntervalMinutes​(@Param(name="minutes")
                                               long minutes)
        Set the duration of an interval.
        Parameters:
        minutes - The duration of an interval in minutes.
      • getErrorStatisticsIntervalMinutes

        @ManagedAttribute
        long getErrorStatisticsIntervalMinutes()