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

LogQuery

public interface LogQuery
Provides access to log messages already present in the log file.
since
AS 9.0

Fields Summary
public static final String
LOWEST_SUPPORTED_QUERY_LEVEL
The lowest supported log level for which queries may be performed.
public static final int
ALL_RECORDS
Value for the maximumNumberOfResults parameter to {@link #queryServerLog} which returns all results.
public static final int
FIRST_RECORD
Value for the startIndex parameter to {@link #queryServerLog}.
public static final int
LAST_RECORD
Value for the startIndex parameter to {@link #queryServerLog}.
Constructors Summary
Methods Summary
public java.lang.String[]getDiagnosticCauses(java.lang.String messageID)

public java.lang.String[]getDiagnosticChecks(java.lang.String messageID)

public java.lang.StringgetDiagnosticURI(java.lang.String messageID)

public LogQueryResultqueryServerLog(java.lang.String name, long startIndex, boolean searchForward, int maxRecords, java.lang.Long fromTime, java.lang.Long toTime, java.lang.String logLevel, java.util.Set modules, java.util.List nameValuePairs)
Query a server log file for records beginning at index startIndex.

The name parameter may be {@link LogFileAccess#MOST_RECENT_NAME} to query the current server log file, or may be any specific server log file as returned by {@link LogFileAccess#getLogFileNames}.

To query log records starting at the beginning of the file and moving forward, use startIndex={@link #FIRST_RECORD}. To query records beginning at the end of the file and moving backwards, use startIndex={@link #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

  • What are the legal keys and values of 'nameValueMap'

param
name a specific log file name or {@link LogFileAccess#MOST_RECENT_NAME}
param
startIndex the location within the LogFile to begin.
param
searchForward true to move forward, false to move backward from startIndex
param
maxRecords the maximum number of results to be returned, {@link #ALL_RECORDS} for all
param
fromTime the lower bound time, may be null (inclusive)
param
toTime the upper bound time, may be null (exclusive)
param
logLevel the minimum log level to return, see {@link Level}
param
modules one or more modules as defined in {@link LogModuleNames} or any valid Logger name
param
nameValuePairs name-value pairs to match. Names need not be unique.
return
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
LogRecordFields
see
LogModuleNames