Ceylan LogMX Parser able to parse a log file with multi-line support and Relative Date support. More...
Public Member Functions | |
String | getParserName () |
Returns the name of this parser. | |
String | getSupportedFileType () |
Returns the supported file type for this parser. | |
List< String > | getUserDefinedFields () |
Returns the ordered list of user-defined fields to display (given by their key), for each entry. | |
Date | getRelativeEntryDate (ParsedEntry pEntry) throws Exception |
Returns the relative timestamp (execution time) of given entry. | |
Date | getAbsoluteEntryDate (ParsedEntry pEntry) throws Exception |
Returns the Date object for the given entry. | |
Protected Member Functions | |
void | parseLine (String line) throws Exception |
Process the new line of text read from file. | |
Private Member Functions | |
void | recordPreviousEntryIfExists () throws Exception |
Sends to LogMX the current parsed log entry. | |
void | prepareNewEntry () throws Exception |
Sends to LogMX the current parsed log entry, then creates a new one. | |
Private Attributes | |
ParsedEntry | entry = null |
Current parsed log entry. | |
StringBuilder | entryMsgBuffer = null |
Buffer for Entry message (improves performance for multi-lines entries). | |
Static Private Attributes | |
static final SimpleDateFormat | DatePattern |
Entry date format. | |
static final Pattern | TraceBeginPattern |
Pattern to match the beginning of a trace, like '<0.31.0>|': | |
static final String | ExecutionTimeKey = "Wallclock Time" |
Key of extra user-defined field about execution time. | |
static final String | EmitterLocationKey = "Emitter Location" |
Key of extra user-defined field about execution time. | |
static final String | CategoryKey = "Categorization" |
Key of extra user-defined field about execution time. | |
static final String[] | ArrayOfKeys |
static final List< String > | KeysOfUserDefinedFields |
User-defined fields names (here, only one). |
Ceylan LogMX Parser able to parse a log file with multi-line support and Relative Date support.
Here is an example of log file suitable for this parser: """ <0.31.0>|Object-17|Actor.Theme.Object.SomeObject|3168318240218 |08/04/2008 04:41:24|ceylan_test.org |Execution.Topic.SpecificEvent|2|No answer from Object XYZ """
Definition at line 30 of file CeylanTraceParser.java.
Date ceylan::parser::CeylanTraceParser::getAbsoluteEntryDate | ( | ParsedEntry | pEntry | ) | throws Exception [inline] |
Returns the Date object for the given entry.
Definition at line 226 of file CeylanTraceParser.java.
References DatePattern.
String ceylan::parser::CeylanTraceParser::getParserName | ( | ) | [inline] |
Returns the name of this parser.
Definition at line 74 of file CeylanTraceParser.java.
Date ceylan::parser::CeylanTraceParser::getRelativeEntryDate | ( | ParsedEntry | pEntry | ) | throws Exception [inline] |
Returns the relative timestamp (execution time) of given entry.
Definition at line 211 of file CeylanTraceParser.java.
References ExecutionTimeKey.
String ceylan::parser::CeylanTraceParser::getSupportedFileType | ( | ) | [inline] |
Returns the supported file type for this parser.
Definition at line 84 of file CeylanTraceParser.java.
List<String> ceylan::parser::CeylanTraceParser::getUserDefinedFields | ( | ) | [inline] |
Returns the ordered list of user-defined fields to display (given by their key), for each entry.
Definition at line 199 of file CeylanTraceParser.java.
References KeysOfUserDefinedFields.
void ceylan::parser::CeylanTraceParser::parseLine | ( | String | line | ) | throws Exception [inline, protected] |
Process the new line of text read from file.
Definition at line 94 of file CeylanTraceParser.java.
References CategoryKey, EmitterLocationKey, entry, entryMsgBuffer, ExecutionTimeKey, prepareNewEntry(), recordPreviousEntryIfExists(), and TraceBeginPattern.
void ceylan::parser::CeylanTraceParser::prepareNewEntry | ( | ) | throws Exception [inline, private] |
Sends to LogMX the current parsed log entry, then creates a new one.
Exception |
Definition at line 256 of file CeylanTraceParser.java.
References entry, entryMsgBuffer, and recordPreviousEntryIfExists().
Referenced by parseLine().
void ceylan::parser::CeylanTraceParser::recordPreviousEntryIfExists | ( | ) | throws Exception [inline, private] |
Sends to LogMX the current parsed log entry.
Exception |
Definition at line 239 of file CeylanTraceParser.java.
References entry, and entryMsgBuffer.
Referenced by parseLine(), and prepareNewEntry().
final String [] ceylan::parser::CeylanTraceParser::ArrayOfKeys [static, private] |
Definition at line 61 of file CeylanTraceParser.java.
final String ceylan::parser::CeylanTraceParser::CategoryKey = "Categorization" [static, private] |
Key of extra user-defined field about execution time.
Definition at line 59 of file CeylanTraceParser.java.
Referenced by parseLine().
final SimpleDateFormat ceylan::parser::CeylanTraceParser::DatePattern [static, private] |
new SimpleDateFormat( "dd/MM/yyyy HH:mm:ss" )
Entry date format.
Definition at line 38 of file CeylanTraceParser.java.
Referenced by getAbsoluteEntryDate().
final String ceylan::parser::CeylanTraceParser::EmitterLocationKey = "Emitter Location" [static, private] |
Key of extra user-defined field about execution time.
Definition at line 56 of file CeylanTraceParser.java.
Referenced by parseLine().
ParsedEntry ceylan::parser::CeylanTraceParser::entry = null [private] |
Current parsed log entry.
Definition at line 34 of file CeylanTraceParser.java.
Referenced by parseLine(), prepareNewEntry(), and recordPreviousEntryIfExists().
StringBuilder ceylan::parser::CeylanTraceParser::entryMsgBuffer = null [private] |
Buffer for Entry message (improves performance for multi-lines entries).
Definition at line 49 of file CeylanTraceParser.java.
Referenced by parseLine(), prepareNewEntry(), and recordPreviousEntryIfExists().
final String ceylan::parser::CeylanTraceParser::ExecutionTimeKey = "Wallclock Time" [static, private] |
Key of extra user-defined field about execution time.
Definition at line 53 of file CeylanTraceParser.java.
Referenced by getRelativeEntryDate(), and parseLine().
final List<String> ceylan::parser::CeylanTraceParser::KeysOfUserDefinedFields [static, private] |
Arrays.asList( ArrayOfKeys )
User-defined fields names (here, only one).
Definition at line 65 of file CeylanTraceParser.java.
Referenced by getUserDefinedFields().
final Pattern ceylan::parser::CeylanTraceParser::TraceBeginPattern [static, private] |
Pattern.compile("^<\\d++\\.\\d++\\.\\d++>\\|.*$")
Pattern to match the beginning of a trace, like '<0.31.0>|':
Definition at line 43 of file CeylanTraceParser.java.
Referenced by parseLine().