Java EE 5 SDK

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

All Known Subinterfaces:
Logging

public interface LogFileAccess

Provides access to log files.

Since:
AS 9.0

Field Summary
static String ACCESS_KEY
          Key designating the access.log log file.
static String MOST_RECENT_NAME
          Value meaning the most current version of the log file.
static String SERVER_KEY
          Key designating the server.log log files.
 
Method Summary
 String getLogFile(String key, String fileName)
          The entire specified log file is read, converted into a String, and returned.
 String[] getLogFileKeys()
          Keys which may be used to specify which log file to access.
 String[] getLogFileNames(String key)
          The names returned are not full paths but the simple file names of the log files.
 void rotateAllLogFiles()
          Rotate all log files as soon as possible.
 void rotateLogFile(String key)
          Rotate the log file of the specified type.
 

Field Detail

MOST_RECENT_NAME

static final String MOST_RECENT_NAME
Value meaning the most current version of the log file.

See Also:
Constant Field Values

SERVER_KEY

static final String SERVER_KEY
Key designating the server.log log files. Not necessarily the same as the file name of the log file.

See Also:
Constant Field Values

ACCESS_KEY

static final String ACCESS_KEY
Key designating the access.log log file. Not necessarily the same as the file name of the log file.

See Also:
Constant Field Values
Method Detail

getLogFileKeys

String[] getLogFileKeys()
Keys which may be used to specify which log file to access. Legal values include:

Returns:
a String[] of the legal keys which designate log files

getLogFileNames

String[] getLogFileNames(String key)
The names returned are not full paths but the simple file names of the log files. The last name in the resulting String[] will always be that of the current log file. In other words if the String[] las length 3, then result[2] will be the name of the current log file.

Note that it is possible for log file rotation to occur after making this call, thus rendering the list incomplete.

The resulting names may be passed to getLogFile(java.lang.String, java.lang.String) to retrieve the contents.

The only legal key supported is SERVER_KEY.

Parameters:
key - a key specifying the type of log file
Returns:
String[] of all log filenames

getLogFile

String getLogFile(String key,
                  String fileName)
The entire specified log file is read, converted into a String, and returned. The resulting String may be quite large.

The only legal key supported is SERVER_KEY.

Parameters:
key - a legal key designating a log file
fileName - a log file name as returned by getLogFileNames(java.lang.String) or MOST_RECENT_NAME if current log file is desired.
Returns:
the contents of the specified log file in a String
See Also:
getLogFileKeys()

rotateAllLogFiles

void rotateAllLogFiles()
Rotate all log files as soon as possible. May return prior to the rotation occuring.


rotateLogFile

void rotateLogFile(String key)
Rotate the log file of the specified type. Legal values are those returned by getLogFileKeys(). Legal values include:

Parameters:
key -

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.