Package org.glassfish.admin.amx.logging
Interface LogFileAccess
-
@Taxonomy(stability=EXPERIMENTAL) public interface LogFileAccess
Provides access to log files.- Since:
- AS 9.0
-
-
Field Summary
Fields Modifier and Type Field Description 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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
@ManagedAttribute String[] getLogFileKeys()
Keys which may be used to specify which log file to access. Legal values include:SERVER_KEY
ACCESS_KEY
is not supported
- Returns:
- a String[] of the legal keys which designate log files
-
getLogFileNames
@ManagedOperation(impact=0) String[] getLogFileNames(@Param(name="key") 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
@ManagedOperation(impact=0) String getLogFile(@Param(name="key") String key, @Param(name="fileName") 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 filefileName
- a log file name as returned bygetLogFileNames(java.lang.String)
orMOST_RECENT_NAME
if current log file is desired.- Returns:
- the contents of the specified log file in a String
- See Also:
getLogFileKeys()
-
rotateAllLogFiles
@ManagedOperation(impact=1) void rotateAllLogFiles()
Rotate all log files as soon as possible. May return prior to the rotation occuring.
-
rotateLogFile
@ManagedOperation(impact=1) void rotateLogFile(@Param(name="key") String key)
Rotate the log file of the specified type. Legal values are those returned bygetLogFileKeys()
. Legal values include:SERVER_KEY
ACCESS_KEY
is not supported
- Parameters:
key
-
-
-