|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the log file handlers methods. A log file handler is used to apply filters and analyzers on a log file. Filters dans analyzers can be added before and/or after log file parsing.
Method Summary | |
void |
addLogHandlerListener(LALogHandlerListener listener)
Adds a listener. |
void |
fireEndParsing()
Fires an end parsing event. |
void |
fireStartParsing()
Fires a start parsing event. |
LAAnalyzer[] |
getAnalyzers()
Returns log analyzers added to the handler with setAnalyzers(LAAnalyzer[]) . |
LAConverter |
getConverter(int index)
Returns the converter at the specified index. |
LAConverter |
getConverter(java.lang.String literal)
Returns the converter identified by the specified literal (for example, "%m" generally returns the messageLabel converter). |
int |
getConverterIndex(java.lang.String literal)
Returns the index of the identified by the specified literal. |
LAConverter[] |
getConverters()
Returns pattern converters. |
java.lang.Exception |
getLastException()
Returns the last exception thrown by the parsing process. |
int |
getMaxRecords()
Returns the number of records to parse; 0 for no limitation. |
LAMessage |
getMessage(int index)
Returns the messageLabel at the specified position. |
LAConverter |
getMessageConverter()
Returns the current messageLabel converter used to extend messageLabel text with unparsed lines. |
LAMessage[] |
getMessages(int start,
int end)
Returns the messages between specified positions. |
int |
getPercentDone()
Returns the done percentage of the parsed file. |
int |
getSize()
Returns the real number of messages in the log, not only in cache in case of a load on demand parsed log. |
boolean |
isParsing()
Returns true if the handler is currently parsing the log. |
void |
parse()
Parses the log content of the FilesSetReader . |
void |
removeLogHandlerListener(LALogHandlerListener listener)
Removes a listener. |
void |
setAnalyzers(LAAnalyzer[] newAnalyzers)
Adds new analyzers to the log handler. |
void |
setMaxRecords(int maxRecords)
Number of records to parse; 0 for no limitation. |
Methods inherited from interface java.lang.Runnable |
run |
Method Detail |
public LAAnalyzer[] getAnalyzers()
setAnalyzers(LAAnalyzer[])
.
public void setAnalyzers(LAAnalyzer[] newAnalyzers)
newAnalyzers
- Analyzers to add.public LAConverter getConverter(int index)
index
- Converter index.
public LAConverter getConverter(java.lang.String literal) throws UnknownOrLiteralConverterException
literal
- Converter literal as %m" or %"p" or "%H{CLIENTIP}".
UnknownOrLiteralConverterException
- If the literal does not identify a non literal column.public LAConverter[] getConverters()
public int getConverterIndex(java.lang.String literal) throws UnknownOrLiteralConverterException
literal
- Converter literal as %m" or %"p" or "%H{CLIENTIP}".
UnknownOrLiteralConverterException
- If the literal does not identify a non literal column.public java.lang.Exception getLastException()
public int getMaxRecords()
public void setMaxRecords(int maxRecords)
maxRecords
- Number of records.public LAConverter getMessageConverter()
LAMessage.extendsMessage(String)
public int getPercentDone()
public LAMessage getMessage(int index)
index
- Physical index of the messageLabel in the log file.
public LAMessage[] getMessages(int start, int end)
getMessage(int)
to read messageLabel from the log file.
start
- start physicial index (included in the result).end
- end physical index (included in the result).
public int getSize()
public boolean isParsing()
public void addLogHandlerListener(LALogHandlerListener listener)
listener
- Lister to add.public void fireStartParsing()
public void fireEndParsing()
public void parse() throws ParsingException
FilesSetReader
. Calls, in order :
Because a LALogHandler
is a Runnable
, for a threaded
parsing you must start it in a new Thread
:
handler.addLogHandlerListener(myLALogHandlerListener); Thread handlerThread = new Thread(handler); handlerThread.start();
ParsingException
- If can't parse messageLabel.AbstractLogHandler
public void removeLogHandlerListener(LALogHandlerListener listener)
listener
- Lister to remove.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |