ceylan::parser::CeylanTraceParser Class Reference

Ceylan LogMX Parser able to parse a log file with multi-line support and Relative Date support. More...

Inheritance diagram for ceylan::parser::CeylanTraceParser:
Inheritance graph
[legend]
Collaboration diagram for ceylan::parser::CeylanTraceParser:
Collaboration graph
[legend]

List of all members.

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).

Detailed Description

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 """

See also:
erlang/traces/conf/logmx/TraceSample.txt

Definition at line 30 of file CeylanTraceParser.java.


Member Function Documentation

Date ceylan::parser::CeylanTraceParser::getAbsoluteEntryDate ( ParsedEntry  pEntry  )  throws Exception [inline]

Returns the Date object for the given entry.

See also:
com.lightysoft.logmx.mgr.LogFileParser, getAbsoluteEntryDate(com.lightysoft.logmx.business.ParsedEntry)

Definition at line 226 of file CeylanTraceParser.java.

References DatePattern.

String ceylan::parser::CeylanTraceParser::getParserName (  )  [inline]

Returns the name of this parser.

See also:
com.lightysoft.logmx.mgr.LogFileParser::getParserName()

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.

See also:
com.lightysoft.logmx.mgr.LogFileParser, getRelativeEntryDate(com.lightysoft.logmx.business.ParsedEntry)

Definition at line 211 of file CeylanTraceParser.java.

References ExecutionTimeKey.

String ceylan::parser::CeylanTraceParser::getSupportedFileType (  )  [inline]

Returns the supported file type for this parser.

See also:
com.lightysoft.logmx.mgr.LogFileParser::getSupportedFileType()

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.

See also:
com.lightysoft.logmx.mgr.LogFileParser::getUserDefinedFields()

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.

See also:
com.lightysoft.logmx.mgr.LogFileParser::parseLine(java.lang.String)

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.

Exceptions:
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.

Exceptions:
Exception 

Definition at line 239 of file CeylanTraceParser.java.

References entry, and entryMsgBuffer.

Referenced by parseLine(), and prepareNewEntry().


Member Data Documentation

final String [] ceylan::parser::CeylanTraceParser::ArrayOfKeys [static, private]
Initial value:

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]
Initial value:
 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]
Initial value:
        Arrays.asList( ArrayOfKeys )

User-defined fields names (here, only one).

Definition at line 65 of file CeylanTraceParser.java.

Referenced by getUserDefinedFields().

Initial value:
        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().


The documentation for this class was generated from the following file:
Generated on Mon Nov 29 13:42:01 2010 for Ceylan by  doxygen 1.6.3