Devices, including gateway devices and sub-devices, can submit logs to IoT Platform. You can query local device logs and troubleshoot issues on the Device Log page of the IoT Platform console.

Prerequisites

  • An SDK for Android or SDK for C is used to develop a device. Logs are submitted by the device. For more information about how to reset a password, see Device log reporting.
  • Device local log reporting is turned on. To turn on the switch, you must log on to the IoT Platform and perform the following steps: 1. Choose Devices > Devices. 2. Find the required device in the device list and click View. 3. On the Device Details page, turn on Device local log reporting.

Query local device logs

  1. Log on to the IoT Platform console.
  2. On the Overview page, find the instance that you want to manage and click the instance name to go to the Instance Details page.
    Important Enterprise Edition instances are available in the China (Shanghai) and Japan (Tokyo) regions. If the Enterprise Edition instances are unavailable in the region that you select, skip this step.
    Overview
  3. In the left-side navigation pane, choose Maintenance > Device Log.
  4. Select a product and click the Device local log tab.
  5. Specify the search conditions and click Search.

    The following table describes the supported search conditions.

    Search conditionDescription
    DeviceNameEnter a DeviceName. You can search for the logs of a device by DeviceName.
    TraceIdEnter a trace ID to search for the logs of series modules.
    Module nameEnter a module name to search for the logs that are generated by the module.
    KeywordEnter a keyword to search for the logs that contain the keyword. Supported keywords: the name of a parameter in an API request, the failure cause, the ID of a message, the ID of a device, and the name of an operation.
    Time rangeSelect a time range.

Log fields

The following table describes the log fields.

ParametersDescription
Reported AtThe time when the device submitted the log.
Collected AtThe time when the device collected the log.
TraceIdThe trace ID. You can use this ID to search for series modules.
DeviceNameThe DeviceName of the device.
The log level.By default, logs of all levels are displayed. You can query only logs of a specific level. Log levels other than the OTHER level are in descending order:
  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • OTHER: another log level
ModuleThe name of the module that generates the log.
  • If the device uses the SDK for Android, the module name is ALK-LK.
  • If the device uses the SDK for C, the module name is user-specified.
DescriptionThe content of the log.

Analyze device logs

The log content includes the Code parameter. You can analyze device logs based on response codes.

The HTTP status code may be generated by the device SDK or customized by the user. For more information about the status codes that may be returned if the device uses the SDK for Android, see Error codes. For more information about the status codes that may be returned if the device uses the SDK for C, see Common error codes.