Methods Summary |
---|
public com.sun.appserv.management.ext.logging.Logging | getLogging()
return mLogging;
|
private long | now()
return System.currentTimeMillis();
|
public com.sun.appserv.management.ext.logging.LogQueryResult[] | queryAll()Get all available log records in all files for all modules of all
available log levels.
final String[] names = getLogging().getLogFileNames( SERVER_KEY );
final List<LogQueryResult> all = new ArrayList<LogQueryResult>( names.length );
for( final String name : names )
{
// a log file could disappear while querying
try
{
final LogQueryResult result = queryAllInFile( name );
all.add( result );
}
catch( Exception e )
{
// ignore and try next one.
}
}
final LogQueryResult[] results = new LogQueryResultImpl[ all.size() ];
return all.toArray( results );
|
public com.sun.appserv.management.ext.logging.LogQueryResult | queryAllCurrent()Get all available log records for all modules in the most current log file.
return queryAllInFile( MOST_RECENT_NAME );
|
public com.sun.appserv.management.ext.logging.LogQueryResult | queryAllInFile(java.lang.String name)Get all available log records for all modules in the specified log file.
final int startIndex = FIRST_RECORD;
final boolean searchForward = true;
final int maxRecords = ALL_RECORDS;
final Long startTime = null;
final Long stopTime = null;
final List<Attribute> attrs = null;
final LogQueryResult result = getLogging().queryServerLog(
name,
startIndex,
searchForward,
maxRecords,
startTime,
stopTime,
LOWEST_SUPPORTED_QUERY_LEVEL,
LogModuleNames.ALL_NAMES,
attrs );
return result;
|
public com.sun.appserv.management.ext.logging.LogQueryResult | queryServerLog(java.lang.String logLevel, java.util.Set modules)Get all log records of the specified error level or higher level for a
all specified modules in the most current log file.
final String name = MOST_RECENT_NAME;
final int startIndex = FIRST_RECORD;
final boolean searchForward = true;
final int maxRecords = ALL_RECORDS;
final Long startTime = null;
final Long stopTime = null;
final List<Attribute> attrs = null;
assert( getLogging() != null );
final LogQueryResult result = getLogging().queryServerLog(
name,
startIndex,
searchForward,
maxRecords,
startTime,
stopTime,
logLevel,
modules,
attrs );
return result;
|
public com.sun.appserv.management.ext.logging.LogQueryResult | queryServerLog(java.lang.String logLevel, java.lang.String moduleID)Get all log records of the specified error level or higher level for a
particular module in the most current log file.
return queryServerLog( logLevel, GSetUtil.newSet( moduleID ) );
|
public com.sun.appserv.management.ext.logging.LogQueryResult | queryServerLog(java.lang.String logLevel)Get all log records of the specified error level or higher level for
all modules in the most current log file.
return queryServerLog( logLevel, LogModuleNames.ALL_NAMES );
|
public com.sun.appserv.management.ext.logging.LogQueryResult | queryServerLogRecent(long seconds)Get all available log records for all modules in the most current log file
which have occurred within the last number of seconds.
return queryServerLogRecent( seconds, LogModuleNames.ALL_NAMES );
|
public com.sun.appserv.management.ext.logging.LogQueryResult | queryServerLogRecent(long seconds, java.util.Set modules)Get all available log records for all modules in the most current log file
which have occurred within the last number of seconds.
final String name = MOST_RECENT_NAME;
final int startIndex = LAST_RECORD;
final boolean searchForward = false;
final int maxRecords = ALL_RECORDS;
final Long startTime = now();
final Long stopTime = now() - (seconds * 1000);
final List<Attribute> attrs = null;
final LogQueryResult result = getLogging().queryServerLog(
name,
startIndex,
searchForward,
maxRecords,
startTime,
stopTime,
LOWEST_SUPPORTED_QUERY_LEVEL,
modules,
attrs );
return result;
|