Application - Trace Log Structure
Overview
The QueryRun and CanceRun methods return a “trace_log” array which describes a sequence of trace log events generated by internal processing.
This trace log may contain:
- Warning, Notice, Alarm, and Clear events
- Match Pass and Match Fail events
- [if enabled] Debug, Dump, and Spam events
- [if enabled] Application-Specific Message events
Each trace log has a mandatory fractional epoch “time” stamp.
Each trace log type is identified by its mandatory “path” attribute.
You should be prepared to handle unrecognised trace log events that may be added in the future.
Internal Trace
Internal trace log events must contain “time” and “path”. They may c
| Parameter | Type | Description |
|---|---|---|
time
|
Float | [Required] The fractional epoch timestamp at which the trace log entry was generated. |
path
|
String |
[Required] One of the following:trace.alarm, trace.clear, trace.warning, trace.notice, trace.debug, trace.dump, trace.spam.
|
event_id
|
String |
A string in the format "AA-AA-NNNNN" where each "A" is an arbitrary capital letter "A-Z" and each "N" is an arbitrary digit "0-9". The first two characters indicate the source code module, the second two are the functional area within that module. E.g. SV-AP-10004.Assigned Event IDs are documented in the N-Squared Alarm Guide. This attribute should be present when "path" is trace.alarm, trace.clear, trace.warning, trace.notice.This attribute should not be present when "path" is trace.debug, trace.dump, trace.spam.
|
msg
|
String | [Required] Human-readable trace message string. |
Match Traces
Match traces are “test results” from checks performed by test scripts.
- The “match.pass” and “match.fail” are created by explicit calls to testing Match Methods.
- The “match.abort” is added when a test script instance terminates abnormally with an “abort” string.
| Parameter | Type | Description |
|---|---|---|
time
|
Float | [Required] The fractional epoch timestamp at which the trace log entry was generated. |
path
|
String |
[Required] One of the following:match.pass, match.fail, match.abort.
|
description
|
String | A description of the test which is being performed. |
text
|
String | A message describing how the test succeeded or failed. |
Match trace log entries generated by the execution of Lua test scripts within the LogicApp may be enriched with additional fields. These are described in the LogicApp, but are reproduced here for convenience since they form a core part of the most common use case in platform testing via the N2PTF software product.
| Parameter | Type | Description |
|---|---|---|
action_idx
|
Integer |
[Required] A count for every action performed by this test instance, starting from 1 and incrementing with every action performed.
|
current_action
|
String |
[Required] The key for the action that is currently being performed, or special transition actions: <setup>,
<chain>, <error>, <success>.
|
lua_stack_trace
|
Array of Object |
An optional stack trace which is typically added to match trace log entries that are generated by Lua test scripts. This is an Array of Objects representing the current Lua source code stack from top to bottom at the time of the match log. |
source
|
String | The file name or other chunk label of the Lua source code block in the stack. |
source_line
|
Integer | The source line within the indicated source code block in the stack. |
Protocol Traces
Applications which interface with other components or external entities will typically generate protocol trace log entries whenever an inbound or outbound message is sent/received. The format of these trace log entries will be described in detail in the documentation for that application, and is not reproduced here.
However, there are common guidelines for the attributes of protocol trace log entries which all applications need to follow. Specifically:
- The mandatory “time” stamp indicates the fractional epoch.
- The mandatory “path” should have the syntax
[protocol].[local]_(to|from)_[remote]. - Some standard content fields may be used.
The conventions for the parts of the “path” are as follows.
<protocol>matches RegEx pattern[a-z][a-z0-9]*and identifies the protocol.<local>matches RegEx pattern[a-z][a-z0-9]*and identifies the local endpoint logical function.<remote>matches RegEx pattern[a-z][a-z0-9]*and identifies the remote endpoint logical function.
The following paths are examples of existing paths generated by standard apps:
dns.n2_to_server, smpp.esme_from_smsc, diameter.client_from_server.
The full list of trace log paths generated by each application should be documented within the documentation section for the application itself.
Note that some applications may generate protocol traces for more than one protocol, e.g. the SoapClientApp
may generate one trace log entry with protocol “soap.client_from_server” and a “soap” attribute containing the
SOAP object to encode/decode, and also generate a second independent trace log entry “http.client_from_server”
which contains an “http” attribute with the intermediate HTTP message structure.
In both cases, the attribute key (e.g. “http” or “soap”) which holds the protocol information element should match the protocol part of the path string for that same trace log entry.
| Parameter | Type | Description |
|---|---|---|
time
|
Float | [Required] The fractional epoch timestamp at which the trace log entry was generated. |
path
|
String |
[Required] Path with format [protocol].[local]_(to|from)_[remote] as described above.
|
[protocol]
|
Object |
[Required] A protocol trace log entry should contain an element with the same name as the [protocol] part of the path.For example a protocol trace log with path = smpp.esme_to_smsc should contain an "smpp" element which is
the SMPP object which was encoded into or decoded from the on-the-wire bytes.
|
bytes
|
String |
Most protocol trace log entries will also supply the on-the-wire bytes which contained the encoded message. Some trace logs will omit the "bytes" attribute in order to reduce the size of the overall trace. |
Other Traces
At this time, no other “path” format is supported.
However, downstream trace processing systems should be prepared to accept trace log entries which have a “path”
attribute which does not match the patterns indicated here, and either discard them or display/log them using a
simplified generic format. In all cases, the time and path fields will be present in every trace log entry.