@Taxonomy(stability=EXPERIMENTAL)
public interface LogAnalyzer
Modifier and Type | Field and Description |
---|---|
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() . |
Modifier and Type | Method and Description |
---|---|
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.
|
static final String TIMESTAMP_KEY
getErrorInfo()
.
value is of type Long.static final String SEVERE_COUNT_KEY
getErrorInfo()
.
value is of type Long.static final String WARNING_COUNT_KEY
getErrorInfo()
.
value is of type Long.static final String MODULE_NAME_KEY
getErrorDistribution(long, java.lang.String)
.
value is of type String.@ManagedAttribute Map<String,Number>[] getErrorInfo()
Level.SEVERE
and Level.WARNING
log
entries for the known history. Each entry in the resulting array is a
Map with the following keys:
TIMESTAMP_KEY
of type LongSEVERE_COUNT_KEY
of type IntegerWARNING_COUNT_KEY
of type Integer
The timestamp obtained from each Map may be used as the timestamp when
calling getErrorDistribution(long, java.lang.String)
. For example:
final Map
for( int i = 0; i < infos.length; ++i ) {
final Map
final long timestamp = ((Long)info.get( TIMESTAMP_KEY )).longValue();
Map
}
@ManagedOperation Map<String,Integer> getErrorDistribution(@Param(name="timestamp") long timestamp, @Param(name="level") String level)
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.
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
- @ManagedAttribute String[] getLoggerNames()
@ManagedOperation(impact=0) String[] getLoggerNamesUnder(@Param(name="loggerName") String loggerName)
@ManagedAttribute void setKeepErrorStatisticsForIntervals(@Param(name="numIntervals") int numIntervals)
numIntervals
- number of intervals@ManagedAttribute int getKeepErrorStatisticsForIntervals()
@ManagedAttribute void setErrorStatisticsIntervalMinutes(@Param(name="minutes") long minutes)
minutes
- The duration of an interval in minutes.@ManagedAttribute long getErrorStatisticsIntervalMinutes()
Copyright © 2021. All rights reserved.