Service Logs

Download OpenAPI specification:Download

service_logs_0

Service Logs

The iotcomms.io Developer Portal offers robust logging functionality to support developers in monitoring and troubleshooting system interactions. Logs can be accessed from the Logs section, providing a detailed overview of service execution.

Log Visualization

The Logs section presents a sequence diagram that visualizes all key events during service execution. This includes:

  • SIP Requests

    Displays detailed SIP signaling, such as INVITE, BYE, MESSAGE, and their respective responses, including headers and timestamps.

  • SNS Events

    Logs events published via Amazon Simple Notification Service (SNS).

  • SQS Commands

    Tracks message queue commands processed through Amazon Simple Queue Service (SQS).

  • REST Callbacks

    Captures REST API interactions between your application and the iotcomms.io platform.

Example Log View

The sequence diagram offers a time-based visualization of interactions among entities, such as:

  • SIP Devices

  • iotcomms.io Servers

  • External Systems

It highlights key details such as:

  • Authentication processes (e.g., 407 Proxy Authentication Required)

  • SIP headers (e.g., Call-ID, CSeq)

  • Response times for requests

  • Callback events for dynamic application handling

Below is an example of the log visualization:

Log View Example

This view allows developers to trace the lifecycle of a SIP session or a service request, making it easier to debug and optimize workflows.

Log Search and Filter Functionality

Overview

Logs can be filtered to display only messages matching specified criteria within a chosen time frame. This allows developers to efficiently locate relevant logs and analyze system behavior.

How to Use Search and Filter

  • Default Behavior

    • If no date or filter is specified, logs from the past five minutes are downloaded by default.

    • A maximum of 100 items is shown at a time. To fetch more messages, scroll up or down to load the next or previous set of logs.

  • Date and Time Picker

    • Use the date and time picker on the left to specify a starting point for log retrieval.

    • The system displays the first 100 items from five minutes before the selected time.

  • Filter Input

    • Use the filter input to search for messages containing specific terms.

    • Filters apply to a time interval starting from the selected date and time and extend up to 24 hours later.

    • The syntax for filters is as follows:

      • Space Key

        Acts as an OR operator between terms unless used inside quotes (" ").

      • Quotation Marks (`"`)

        Use to search for exact phrases or terms containing special characters (e.g., -).

      • `+` Operator

        Specifies an AND operation. Example: +“INVITE” +“siprec” searches for logs containing both terms.

      • `+-` Combination

        Excludes terms. Example: +-OPTIONS excludes logs containing OPTIONS.

      • Wildcard (``)

        Supports prefix searches. Example: user* matches user1 and user2.

  • Autocomplete and Suggestions

    • As you type, a list of suggestions appears. Use the Enter or Tab keys to complete a term, or use arrow keys to navigate suggestions.

  • Drag and Drop

    • Terms in the filter input can be rearranged by dragging and dropping their tags.

  • Field-Specific Search

    • Use the "Limit to" dropdown to restrict the search to specific fields.

    • Common fields are highlighted in expanded log items. Clicking on a highlighted field adds its value to the filter input for quick refinement.

Expanding Messages for Detailed View

In the log view, individual messages can be expanded for a more detailed inspection. Expanded messages display additional metadata, such as:

  • Headers (e.g., Call-ID, CSeq)

  • Full message content

  • Timestamps

When inspecting an expanded message, clicking on a specific value (e.g., Call-ID or another unique identifier) automatically copies it to the search filter. This functionality enables developers to:

  • Find Related Messages

    Search for all logs that share the same identifier, such as messages from the same SIP session or transaction.

  • Trace Message Sequences

    Follow the sequence of related messages across the timeline to diagnose issues or understand the flow of a specific interaction.

Color Coding for Easy Correlation

To make it easier to understand how log items correlate within the flow, the log messages are color-coded. By default, color coding is based on the SIP Call-ID, but it can be customized to suit different needs. Available options for color coding include:

  • SIP Call-ID

    (default)

  • Session-ID

  • Recording-ID

  • SIP Dialog ID

  • SIP Transaction ID

This flexibility allows developers to visually group and follow related messages, improving efficiency when analyzing complex workflows.

For example, if logs are color-coded by Call-ID, all messages related to a specific call will appear in the same color, making it easy to trace the entire sequence. If needed, this setting can be reconfigured to focus on other identifiers like Session-ID or Recording-ID, depending on the use case.

A "Share this search" function is available in the log view, allowing developers to share their current search results with others.

Share Icon

By clicking the share icon , a unique HTTPS link is generated. This link includes:

  • The selected time range

  • Any filters applied

Recipients of the link can view the same search results, making it easier to collaborate and troubleshoot as a team.

Using traceId for Advanced Correlation

The traceId is a powerful feature that allows log items spanning multiple systems or sessions to be correlated using the same identifier. This capability enables developers to trace and analyze complex workflows across services.

Overview of traceId

The traceId is a string token that can either be automatically generated by the system or provided by the API user. It propagates through the platform and is included in:

  • All SIP messages sent by the system as the X-TraceId header

  • API responses, where the property is named traceId

  • Implicit callbacks and alarm callbacks invoked by the system

When invoking the platform's APIs, users can pass a custom traceId value. This ensures that the same identifier is preserved across multiple systems and external integrations, allowing for consistent tracking and analysis.

For example, a traceId can be used to:

  • Correlate SIP messages with API callbacks

  • Link events and logs across external systems and the iotcomms.io platform

  • Debug and monitor multi-step processes within and outside the platform

Using traceId in Logs

The traceId is displayed in the log view and can be used as part of the search filter. This enables developers to easily locate and follow all log items associated with a specific traceId.

Example Use Case

If a developer invokes an API with a custom traceId value, all subsequent events triggered by that API call will include the same traceId. For instance:

  1. An API call is made with traceId set to TRACE-123.

  2. The traceId appears in:

    • SIP messages generated by the platform

    • Callback events sent to the application

    • Logs displayed in the Developer Portal

  3. By filtering logs using +TRACE-123, the developer can trace the entire workflow and identify any issues.

Example SIP Message with traceId

INVITE sip:+46123456@192.168.1.136:35090 SIP/2.0
To:  <sip:+46123456@192.168.1.136:35090>
From:  <sip:+46123456@127.0.0.1>;tag=937605
Call-ID: 7257461716882438727
CSeq: 48189 INVITE
X-TraceId: TRACE-123
...

Example REST API Call with traceId

Below is an example of a REST API call to the /placeivrcall endpoint, where the traceId is included in the payload to enable tracking:

Request:

POST /mediaservice/{domain}/placeivrcall
Content-Type: application/json

{
    "destAddr": "sip:+46123456789@{domain}",
    "from": "+46109876543",
    "traceId": "TRACE-123"
}

Response:

{
    "result": {
        "success": true,
        "sessionId": "058d8330-1cc5-11ef-bc2f-4986cebe4a93",
        "traceId": "TRACE-123",
        "message": "Call setup successfully"
    }
}

By leveraging the traceId alongside the logging tools in the Developer Portal, developers can ensure efficient troubleshooting and seamless integration of iotcomms.io services.