Class LogFilter
- java.lang.Object
-
- com.sun.enterprise.server.logging.logviewer.backend.LogFilter
-
@Service public class LogFilter extends Object
LogFilter will be used by Admin Too Log Viewer Front End to filter the records. LogMBean delegates the getLogRecordsUsingQuery method to this class static method.
-
-
Constructor Summary
Constructors Constructor Description LogFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
allChecks(LogFile.LogEntry entry, Date fromDate, Date toDate, String queryLevel, boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch)
This method accepts the first line of the Log Record and checks to see if it matches the query.protected boolean
dateTimeCheck(Date loggedDateTime, Date fromDateTime, Date toDateTime)
protected AttributeList
fetchRecordsUsingQuery(LogFile logFile, long startingRecord, boolean next, boolean forward, long requestedCount, Date fromDate, Date toDate, String logLevel, boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch)
Internal method that will be called from getLogRecordsUsingQuery()List<String>
getInstanceLogFileNames(String instanceName)
LogFile
getLogFile()
This provides access to the LogFile object.LogFile
getLogFile(String fileName)
This fetches or updates logFileCache entries.String
getLogFileForGivenTarget(String targetServerName)
AttributeList
getLogRecordsUsingQuery(String logFileName, Long fromRecord, Boolean next, Boolean forward, Integer requestedCount, Date fromDate, Date toDate, String logLevel, Boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch)
The public method that Log Viewer Front End will be calling on.AttributeList
getLogRecordsUsingQuery(String logFileName, Long fromRecord, Boolean next, Boolean forward, Integer requestedCount, Date fromDate, Date toDate, String logLevel, Boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch, String instanceName)
protected boolean
levelCheck(String loggedLevel, String queryLevelIn, boolean isOnlyLevelFlag)
protected boolean
messageDataCheck(String message, String nvp, String anySearch)
protected boolean
moduleCheck(String loggerName, List modules)
protected boolean
nameValueCheck(String loggedNameValuePairs, Properties queriedNameValueMap)
-
-
-
Method Detail
-
getLogRecordsUsingQuery
public AttributeList getLogRecordsUsingQuery(String logFileName, Long fromRecord, Boolean next, Boolean forward, Integer requestedCount, Date fromDate, Date toDate, String logLevel, Boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch)
The public method that Log Viewer Front End will be calling on. The query will be run on records starting from the fromRecord. If any of the elements for the query is null, then that element will not be used for the query. If the user is interested in viewing only records whose Log Level is SEVERE and WARNING, then the query would look like: fromDate = null, toDate = null, logLevel = WARNING, onlyLevel = false, listOfModules = null, nameValueMap = null.- Parameters:
logFileName
- The LogFile to use to run the query. If null the current server.log will be used. This is not the absolute file name, just the fileName needs to be passed. We will use the parent directory of the previous server.log to build the absolute file name.fromRecord
- The location within the LogFilenext
- True to get the next set of results, false to get the previous setforward
- True to search forward through the log filerequestedCount
- The # of desired return valuesfromDate
- The lower bound datetoDate
- The upper bound datelogLevel
- The minimum log level to displayonlyLevel
- True to only display messsage for "logLevel"listOfModules
- List of modules to matchnameValueMap
- NVP's to match- Returns:
-
getLogFileForGivenTarget
public String getLogFileForGivenTarget(String targetServerName) throws IOException
- Throws:
IOException
-
getLogRecordsUsingQuery
public AttributeList getLogRecordsUsingQuery(String logFileName, Long fromRecord, Boolean next, Boolean forward, Integer requestedCount, Date fromDate, Date toDate, String logLevel, Boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch, String instanceName)
-
fetchRecordsUsingQuery
protected AttributeList fetchRecordsUsingQuery(LogFile logFile, long startingRecord, boolean next, boolean forward, long requestedCount, Date fromDate, Date toDate, String logLevel, boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch)
Internal method that will be called from getLogRecordsUsingQuery()
-
getLogFile
public LogFile getLogFile()
This provides access to the LogFile object.
-
getLogFile
public LogFile getLogFile(String fileName)
This fetches or updates logFileCache entries. _REVISIT_: We may want to limit the entries here as each logFile takes up so much of memory to maintain indexes
-
allChecks
protected boolean allChecks(LogFile.LogEntry entry, Date fromDate, Date toDate, String queryLevel, boolean onlyLevel, List listOfModules, Properties nameValueMap, String anySearch)
This method accepts the first line of the Log Record and checks to see if it matches the query.
-
dateTimeCheck
protected boolean dateTimeCheck(Date loggedDateTime, Date fromDateTime, Date toDateTime)
-
levelCheck
protected boolean levelCheck(String loggedLevel, String queryLevelIn, boolean isOnlyLevelFlag)
-
nameValueCheck
protected boolean nameValueCheck(String loggedNameValuePairs, Properties queriedNameValueMap)
-
-