org.rhq.core.pluginapi.event.log
Class MultiLineLogEntryProcessor
java.lang.Object
org.rhq.core.pluginapi.event.log.MultiLineLogEntryProcessor
- All Implemented Interfaces:
- LogEntryProcessor
- Direct Known Subclasses:
- Log4JLogEntryProcessor
public abstract class MultiLineLogEntryProcessor
- extends Object
- implements LogEntryProcessor
A LogEntryProcessor
for multi-line log files - provides several abstract methods that subclasses must
implement.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected final org.apache.commons.logging.Log log
eventType
protected String eventType
logFile
protected File logFile
minimumSeverity
protected EventSeverity minimumSeverity
includesPattern
protected Pattern includesPattern
dateFormat
protected DateFormat dateFormat
MultiLineLogEntryProcessor
public MultiLineLogEntryProcessor(String eventType,
File logFile)
processLines
@Nullable
public Set<Event> processLines(BufferedReader bufferedReader)
throws IOException
- Description copied from interface:
LogEntryProcessor
- Processes the specified lines from a log file, and returns a set of Events if appropriate, or otherwise, null.
- Specified by:
processLines
in interface LogEntryProcessor
- Parameters:
bufferedReader
- a buffered reader from which the lines can be read
- Returns:
- a set of Events if appropriate, or otherwise, null
- Throws:
IOException
- if reading lines from the supplied buffer reader fails
setMinimumSeverity
public void setMinimumSeverity(EventSeverity minimumSeverity)
setIncludesPattern
public void setIncludesPattern(Pattern includesPattern)
setDateFormat
public void setDateFormat(DateFormat dateFormat)
processLine
protected MultiLineLogEntryProcessor.LogEntry processLine(String line,
Set<Event> events,
MultiLineLogEntryProcessor.LogEntry currentEntry)
getPattern
protected abstract Pattern getPattern()
processPrimaryLine
protected abstract MultiLineLogEntryProcessor.LogEntry processPrimaryLine(Matcher matcher)
throws MultiLineLogEntryProcessor.ParseException
- Throws:
MultiLineLogEntryProcessor.ParseException
getDefaultDateFormat
protected abstract DateFormat getDefaultDateFormat()
parseDateString
protected Date parseDateString(String dateString)
throws MultiLineLogEntryProcessor.ParseException
- Throws:
MultiLineLogEntryProcessor.ParseException
setDateIfNotSet
protected static void setDateIfNotSet(Date timestamp)
Copyright © 2008 RHQ Project Advisory Board (Red Hat, Inc. and Hyperic, Inc.). All Rights Reserved.