FileDocCategorySizeDatePackage
LogAnalyzer.javaAPI DocGlassfish v2 API5573Fri May 04 22:30:50 BST 2007com.sun.appserv.management.ext.logging

LogAnalyzer

public interface LogAnalyzer
Provides summary information about important logging events. PRELIMINARY--SUBJECT TO CHANGES/ADDITIONS
since
AS 9.0

Fields Summary
public static final String
TIMESTAMP_KEY
Key into any Map returned from {@link #getErrorInfo}. value is of type Long.
public static final String
SEVERE_COUNT_KEY
Key into any Map returned from {@link #getErrorInfo}. value is of type Long.
public static final String
WARNING_COUNT_KEY
Key into any Map returned from {@link #getErrorInfo}. value is of type Long.
public static final String
MODULE_NAME_KEY
Key into any Map returned from {@link #getErrorDistribution}. value is of type String.
Constructors Summary
Methods Summary
public java.util.MapgetErrorDistribution(long timestamp, java.lang.String level)
Get the number of log entries for a particular timestamp of a particular {@link 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 {@link LogModuleNames} or any valid Logger name. The corresponding value is the count for that module of the requested level.

param
timestamp a timestamp as obtained using TIME_STAMP_KEY from one of the Maps returned by {@link #getErrorInfo}. Note that it is a 'long' not a 'Long' and is required.
param
level
return
Map

public java.util.Map[]getErrorInfo()
Get a summary of the {@link Level#SEVERE} and {@link Level#WARNING} log entries for the known history. Each entry in the resulting array is a Map with the following keys:
  • {@link #TIMESTAMP_KEY} of type Long
  • {@link #SEVERE_COUNT_KEY} of type Integer
  • {@link #WARNING_COUNT_KEY} of type Integer
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 {@link #getErrorDistribution}. 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 );
}

return
Map

public longgetErrorStatisticsIntervalMinutes()

public intgetKeepErrorStatisticsForIntervals()

public java.lang.String[]getLoggerNames()

return
all the logger names currently in use

public java.lang.String[]getLoggerNamesUnder(java.lang.String loggerName)

return
all the logger names currently in use under this logger.

public voidsetErrorStatisticsIntervalMinutes(long minutes)
Set the duration of an interval.

param
minutes The duration of an interval in minutes.

public voidsetKeepErrorStatisticsForIntervals(int numIntervals)
Set the number of intervals error statistics should be maintained.

param
numIntervals number of intervals