Java EE 5 SDK

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

All Known Subinterfaces:
Logging

public interface LogQuery

Provides access to log messages already present in the log file.

Since:
AS 9.0

Field Summary
static int ALL_RECORDS
          Value for the maximumNumberOfResults parameter to queryServerLog(java.lang.String, long, boolean, int, java.lang.Long, java.lang.Long, java.lang.String, java.util.Set, java.util.List) which returns all results.
static int FIRST_RECORD
          Value for the startIndex parameter to queryServerLog(java.lang.String, long, boolean, int, java.lang.Long, java.lang.Long, java.lang.String, java.util.Set, java.util.List).
static int LAST_RECORD
          Value for the startIndex parameter to queryServerLog(java.lang.String, long, boolean, int, java.lang.Long, java.lang.Long, java.lang.String, java.util.Set, java.util.List).
static String LOWEST_SUPPORTED_QUERY_LEVEL
          The lowest supported log level for which queries may be performed.
 
Method Summary
 String[] getDiagnosticCauses(String messageID)
           
 String[] getDiagnosticChecks(String messageID)
           
 String getDiagnosticURI(String messageID)
           
 LogQueryResult queryServerLog(String name, long startIndex, boolean searchForward, int maxRecords, Long fromTime, Long toTime, String logLevel, Set<String> modules, List<Attribute> nameValuePairs)
          Query a server log file for records beginning at index startIndex.
 

Field Detail

LOWEST_SUPPORTED_QUERY_LEVEL

static final String LOWEST_SUPPORTED_QUERY_LEVEL
The lowest supported log level for which queries may be performed.


ALL_RECORDS

static final int ALL_RECORDS
Value for the maximumNumberOfResults parameter to queryServerLog(java.lang.String, long, boolean, int, java.lang.Long, java.lang.Long, java.lang.String, java.util.Set, java.util.List) which returns all results.

See Also:
Constant Field Values

FIRST_RECORD

static final int FIRST_RECORD
Value for the startIndex parameter to queryServerLog(java.lang.String, long, boolean, int, java.lang.Long, java.lang.Long, java.lang.String, java.util.Set, java.util.List).

See Also:
Constant Field Values

LAST_RECORD

static final int LAST_RECORD
Value for the startIndex parameter to queryServerLog(java.lang.String, long, boolean, int, java.lang.Long, java.lang.Long, java.lang.String, java.util.Set, java.util.List).

See Also:
Constant Field Values
Method Detail

queryServerLog

LogQueryResult queryServerLog(String name,
                              long startIndex,
                              boolean searchForward,
                              int maxRecords,
                              Long fromTime,
                              Long toTime,
                              String logLevel,
                              Set<String> modules,
                              List<Attribute> nameValuePairs)
Query a server log file for records beginning at index startIndex.

The name parameter may be LogFileAccess.MOST_RECENT_NAME to query the current server log file, or may be any specific server log file as returned by LogFileAccess.getLogFileNames(java.lang.String).

To query log records starting at the beginning of the file and moving forward, use startIndex=FIRST_RECORD. To query records beginning at the end of the file and moving backwards, use startIndex=LAST_RECORD and specify searchForward=false.

If searchForward is true, then log records beginning with startRecord (inclusive) and later are considered by the query.
If searchForward is false, then log records beginning at startRecord - 1 and earlier are considered by the query.

Because a log file could be deleted

QUESTIONS TO RESOLVE

Parameters:
name - a specific log file name or LogFileAccess.MOST_RECENT_NAME
startIndex - the location within the LogFile to begin.
searchForward - true to move forward, false to move backward from startIndex
maxRecords - the maximum number of results to be returned, ALL_RECORDS for all
fromTime - the lower bound time, may be null (inclusive)
toTime - the upper bound time, may be null (exclusive)
logLevel - the minimum log level to return, see Level
modules - one or more modules as defined in LogModuleNames or any valid Logger name
nameValuePairs - name-value pairs to match. Names need not be unique.
Returns:
LogQueryResult when using AMX client proxy. Actual type returned from the MBean is List<Serializable[]> The first Serializable[] is a String[] which contains the field names. Subsequent Serializable[] each represent a log record with each element representing a field within that log record.
See Also:
LogRecordFields, LogModuleNames

getDiagnosticCauses

String[] getDiagnosticCauses(String messageID)

getDiagnosticChecks

String[] getDiagnosticChecks(String messageID)

getDiagnosticURI

String getDiagnosticURI(String messageID)

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.