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.
- 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 View. 3. On the Device Details page, turn on the Device local log reporting switch. . 2. Find the required device in the device list, and click
Query local device logs
- Log on to the IoT Platform console.
- In the left-side navigation pane, choose .
- Select a product, and then click the Device local log tab.
- 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.
The following table lists the log fields.
|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:
|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.