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.
- 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 View. 3. On the Device Details page, turn on Device local log reporting. . 2. Find the required device in the device list and click
Query local device logs
- Log on to the IoT Platform console.
- 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.
- In the left-side navigation pane, choose .
- Select a product and click the Device local log tab.
- Specify the search conditions and click Search.
The following table describes the supported search conditions.
Search condition Description DeviceName Enter a DeviceName. You can search for the logs of a device by DeviceName. TraceId Enter a trace 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. Keyword Enter 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 range Select a time range.
The following table describes the log fields.
|Reported At||The time when the device submitted the log.|
|Collected At||The time when the device collected the log.|
|TraceId||The trace ID. You can use this ID to search for series modules.|
|DeviceName||The 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: |
|Module||The name of the module that generates the log. |
|Description||The 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.