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

LogFileAccess

public interface LogFileAccess
Provides access to log files.
since
AS 9.0

Fields Summary
public static final String
MOST_RECENT_NAME
Value meaning the most current version of the log file.
public static final String
SERVER_KEY
Key designating the server.log log files. Not necessarily the same as the file name of the log file.
public static final String
ACCESS_KEY
Key designating the access.log log file. Not necessarily the same as the file name of the log file.
Constructors Summary
Methods Summary
public java.lang.StringgetLogFile(java.lang.String key, java.lang.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 {@link #SERVER_KEY}.

param
key a legal key designating a log file
param
fileName a log file name as returned by {@link #getLogFileNames} or {@link #MOST_RECENT_NAME} if current log file is desired.
return
the contents of the specified log file in a String
see
#getLogFileKeys

public java.lang.String[]getLogFileKeys()
Keys which may be used to specify which log file to access. Legal values include:
  • {@link #SERVER_KEY}
  • {@link #ACCESS_KEY} is not supported

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

public java.lang.String[]getLogFileNames(java.lang.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 {@link #getLogFile} to retrieve the contents.

The only legal key supported is {@link #SERVER_KEY}.

param
key a key specifying the type of log file
return
String[] of all log filenames

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

public voidrotateLogFile(java.lang.String key)
Rotate the log file of the specified type. Legal values are those returned by {@link #getLogFileKeys}. Legal values include:
  • {@link #SERVER_KEY}
  • {@link #ACCESS_KEY} is not supported

param
key