Each parser is a subclass of the abstract class, org.eclipse.hyades.logging.parsers.Parser, and is part of the same package as the abstract class. Its name identifies the type of log being parsed and the product that generated the log.
The Log Analyzer uses the following parser classes:
Each parser has a parse method that examines the contents of a log. For each record in the log, the parser sets the contents of a Common Base Event class. Furthermore, it passes arrays of Common Base Events to a class interface ILogger using its write method.
Note: Common Base Events written to the ILogger can be reset and then reused.
Each parser has a parse method that is invoked to parse a log with the following parameter: ILogger logger
The ILogger logger parameter identifies the logger to which the Common Base Event arrays are written.
Parsers are invoked with fragments of code, for example: logParser.parse(ILogger);
You can set the configuration on a parser by means of the parser.setUserInput(Hashtable table) API as shown in the code example below:
Hashtable parameters = new Hashtable(); parameters.put("file_path", "C:\\myLogFile.log"); parser.setUserInput(parameters);
The parser.setUserInput() method is called to provide information that you want to specify to the parser. Currently, this superclass method handles the path and name of the log file to be parsed. Subclasses will override this method to handle additional information that you want to specify.
Related concepts
Common Base Event model
Related tasks
Guide for creating a log parser and correlator
Guide for creating an analysis engine
Related reference
Common Base Event model description
Common Base Event XML schema specification
JSR-047 and Commons Logging support