log.list

The log.list command is used to list log entries for a thing.

TR50 Request

{
  "list": {
    "command": "log.list",
    "params": {
      "thingKey": "mythingkey",
      "offset": 0,
      "limit": 10,
      "level": 1,
      "corrId": "mycorrelationid",
      "triggerId": "52daa76ae017ace6793a6160"
    }
  }
}
{
  "list": {
    "command": "log.list",
    "params": {
      "thingKey": "mythingkey",
      "offset": 0,
      "limit": 10,
      "last": "24h",
      "level": 2,
      "type": "fileTransfer"
    }
  }
}

Request Parameters

Name Type Required Description
thingKey String   Enter the thingKey for which you want to see the log entries
thingId String   Enter the thingId for which you want to see the log entries
configId String   Enter the ConfigId of the CDP for which you want to see the log entries
triggerId String   The ID of the trigger for which log entries are requested.
campaignId String   The ID of the campaign for which log entries are requested.
It is possible to use triggerId and campaignId in conjunction with thingKey or thingId to see the log entries of a Trigger or Campaign for a particular Thing
type String  

The type includes the following options thing, system, audit, trigger, campaign, license, cdp, fileTransfer, or rateLimit.

The type should correlate to the above identifiers. If the type is specified without any identifiers then it returns all the logs for the type requested.

offset Integer   The starting list offset, used for pagination, defaults to 0 if not specified.
limit Integer   Limits the number of results returned. The maximum you can set is 2000. Defaults to 2000.
start String   Start of a date range for log entries.
end String   End of a date range for log entries.
level Integer   The requested level of the logged entry.
corrId String   The correlation ID that was set to define related data objects.

TR50 Response

If the command is sent successfully a success message and the log list is returned. Otherwise, an error and error message will be returned.

{
  "list": {
    "success": true,
    "params": {
      "count": 42,
      "result": [
        {
          "id": "52daa76ae017ace6793a6160",
          "ts": "2014-03-27T13:39:26.635-04:00",
          "thingId": "531c907b5d80f1330c238757",
          "thingKey": "mythingkey",
          "thingName": "My thing",
          "triggerId": "53f1330c2387571c907b5d80",
          "type": 0,
          "corrId": "mycorrelationid",
          "level": 1,
          "msg": "Log message"
        },
        ...
      ]
    }
  }
}

Response Parameters

Name Type Description
count Integer A count of results returned.
result Array An array of log objects.

Result Array

Name Type Description
id String The object id of the log entry.
ts String The timestamp of the log entry.
thingId String The object id of the thing the log entry is associated with.
thingKey String The key of the thing the log entry is associated with.
thingName String The name of the thing the log entry is associated with.
triggerId String The ID of the trigger that the log entry is associated with.
type Int 0:thing, 1:system, 2:audit, 3:trigger, 4:campaign, 5:license, 6:cdp, 7:rateLimit
corrId String The correlation ID that relate log entries.
level Integer The level of the log entry.
msg String

The message associated with this log entry.