Java EE 5 SDK

com.sun.appserv.management.ext.logging
Interface LogAnalyzer

All Known Subinterfaces:
Logging

public interface LogAnalyzer

Provides summary information about important logging events. PRELIMINARY--SUBJECT TO CHANGES/ADDITIONS

Since:
AS 9.0

Field Summary
static String MODULE_NAME_KEY
          Key into any Map returned from getErrorDistribution(long, java.lang.String).
static String SEVERE_COUNT_KEY
          Key into any Map returned from getErrorInfo().
static String TIMESTAMP_KEY
          Key into any Map returned from getErrorInfo().
static String WARNING_COUNT_KEY
          Key into any Map returned from getErrorInfo().
 
Method Summary
 Map<String,Integer> getErrorDistribution(long timestamp, String level)
          Get the number of log entries for a particular timestamp of a particular Level for all modules.
 Map<String,Number>[] getErrorInfo()
          Get a summary of the Level.SEVERE and Level.WARNING log entries for the known history.
 long getErrorStatisticsIntervalMinutes()
           
 int getKeepErrorStatisticsForIntervals()
           
 String[] getLoggerNames()
           
 String[] getLoggerNamesUnder(String loggerName)
           
 void setErrorStatisticsIntervalMinutes(long minutes)
          Set the duration of an interval.
 void setKeepErrorStatisticsForIntervals(int numIntervals)
          Set the number of intervals error statistics should be maintained.
 

Field Detail

TIMESTAMP_KEY

static final String TIMESTAMP_KEY
Key into any Map returned from getErrorInfo(). value is of type Long.

See Also:
Constant Field Values

SEVERE_COUNT_KEY

static final String SEVERE_COUNT_KEY
Key into any Map returned from getErrorInfo(). value is of type Long.

See Also:
Constant Field Values

WARNING_COUNT_KEY

static final String WARNING_COUNT_KEY
Key into any Map returned from getErrorInfo(). value is of type Long.

See Also:
Constant Field Values

MODULE_NAME_KEY

static final String MODULE_NAME_KEY
Key into any Map returned from getErrorDistribution(long, java.lang.String). value is of type String.

See Also:
Constant Field Values
Method Detail

getErrorInfo

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

Map<String,Integer> getErrorDistribution(long timestamp,
                                         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

getLoggerNames

String[] getLoggerNames()
Returns:
all the logger names currently in use

getLoggerNamesUnder

String[] getLoggerNamesUnder(String loggerName)
Returns:
all the logger names currently in use under this logger.

setKeepErrorStatisticsForIntervals

void setKeepErrorStatisticsForIntervals(int numIntervals)
Set the number of intervals error statistics should be maintained.

Parameters:
numIntervals - number of intervals

getKeepErrorStatisticsForIntervals

int getKeepErrorStatisticsForIntervals()

setErrorStatisticsIntervalMinutes

void setErrorStatisticsIntervalMinutes(long minutes)
Set the duration of an interval.

Parameters:
minutes - The duration of an interval in minutes.

getErrorStatisticsIntervalMinutes

long getErrorStatisticsIntervalMinutes()

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.