Logs

This section contains resources that are related to the Log (log entry). The endpoints in this section enables you to interact with the log data collected by the app. Through the API you can create as well as retrieve log data.
For more information please refer to Getting Started With Logs

Endpoints

Here is the list of endpoints for Logs.

  
    
          POST $BASE_URL/v1/logs/{bucketId}
          GET $BASE_URL/v1/logs/{bucketId}
        
  

1. Create a log entry

Creates a Log entry for further reporting. You can use Konso App to analyze and evaluate the log data. The endpoint below is used to create an entry:

  
    POST $BASE_URL/v1/logs/{bucketId}
  
The request object

The request object contains an instance of an object that is to be sent to create a new Log entry. The object is transferred as part of the request's body.

Attributes

The attributes refers to elements that makes up the request object:

message required
string
The message of the log entry.
timeStamp required
number
Time at which the event was created. It is measured in seconds in the Unix epoch format.
eventId optional
number
Unique numeric identification to attach to the entry.
machineName optional
string
Machine name parameter to associate with the log.
env optional
string
Environment parameter.
level optional
string
Event level: critical, error, warning, information, debug, trace.
correlationId optional
string
Unique identity for binding events, metrics and logs together.
appName optional
string
Application name useful for stream segmentation.
tags optional
strings array
Adding a tag(s) for the entry.
Sample Request Example
  
    POST $BASE_URL/v1/logs/{bucketId}
  
  
    
        {
          "message":"Error Message",
          "timeStamp":"1619636875",
          "correlationId":null,
          "appName":"testApp",
          "level": "error",
          "env": "production",
          "machineName": "my-pc",
          "eventId": 101010,
          "tags": ["test", "mvp"]
        }
      
  

2. Get log entries

Returns entries matching the log query filters. The endpoint below is used to get log entries:

  
    GET $BASE_URL/v1/logs/{bucketId}
  
Filter parameters

Lists and filters log entries. Entries are kept in our storage according to retention days setting.

Attributes

The attributes refers to elements that makes up the filter parameters:

fromDate optional
number
A greater than or equals filter on the list timeStamp field, the value is Unix epoch.
toDate optional
number
A less than or equals filter on the list timeStamp field, the value is Unix epoch.
message optional
string
Message to log.
correlationId optional
string
Only return entries for the correlationId specified.
appName optional
string
Only return entries for the appName specified.
from optional
number
A cursor user in pagination. Default 0
to optional
number
A cursor user in pagination. Default 10
tags optional
string
Filter results by tag. Multiple values are supported.
sort optional
number
1 - timestamp asc, 2 - timestamp desc (default), 3 - level asc, 4 - level desc.
Sample Request
  
    
          GET $BASE_URL/v1/logs/{bucketId}
          ?fromDate=1619636000
          &toDate=1619637000
          &message=login
          &correlationId=
          &appName=testApp
          &tags=tag1
          &tags=tag2
          &from=0
          &to=100
          &sort=2