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

Prerequisites

  • The C SDK is used to develop a device so that the device can submit logs. For more information, see Submit device logs.
  • The Device local log reporting switch 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 the Device local log reporting switch.

Query local device logs

  1. Log on to the IoT Platform console.
  2. In the left-side navigation pane, choose Maintenance > Device Log.
  3. Select a product, and then click the Device local log tab.
  4. Specify the search conditions and click Search.

    The following table lists the supported search conditions.

    Search condition Description
    Device name Enter a device name. You can search for the logs of a device by specifying a device name.
    Tracing ID Enter a tracing ID to search for the logs of series modules.
    Module name Enter a module name to search for the logs that are generated by the module.
    Content keyword Enter a keyword to search for the logs that contain the keyword. Valid keywords include the values of the following parameters: ProductKey, DeviceName, Code, LogLevel, Module, IotId, LogContent, TraceContext, and TraceId.
    Time range Select a time range.

Log fields

The following table lists the log fields.

Parameter Description
Reported At The time when the device submits the log.
Collected At The time when the device collects the log.
TraceId The tracing ID. You can use this ID to search for series modules.
DeviceName The name of the device.
Log Level By default, logs of all levels are displayed. You can only query logs of a certain level. In addition to the OTHER level, log levels are in descending order:
  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • OTHER: another log level
Module Name The name of the module that generates the log, the module name is user-specified.
Content The content of the log.

Analyze device logs

The log content includes the Code parameter. You can analyze device logs based on response codes, see Error codes for device SDKs.