IoT Platform supports uploading local device logs. You can query the local device logs on the Device Log page of the IoT Platform console for troubleshooting. This article describes how to configure Link SDK for C to upload local device logs to IoT Platform.
Prerequisites
- The device authentication information is obtained.
- On the Device Details page of IoT Platform, the Device local log reporting switch is turned on.
- Link SDK for C is obtained.
When you customize an SDK on the SDK customization page, set Advanced Capabilities to Device log.
- A development environment is prepared.
Background information
- For more information about local device logs, see Local device logs.
- For more information about data formats, see Device log reporting.
Process
The application program calls the API operations of Link SDK for C to connect with IoT Platform over MQTT and upload local device logs.
The following figure shows the process. In this example, the ./demos/logpost_basic_demo.c application program is used.
For more information about log uploading-specific API operations, see aiot_logpost_api.h.
What to do next
After device logs are uploaded to IoT Platform, you can view the logs in the IoT Platform console. For more information, see Query local device logs.