You can view logs on the device. You can also view device tags and device tag-specific logs in IoT Platform.
Prerequisites
For more information, see Example.
Device logs
You can view the running result on the device.Device connection logs
The following log data indicates that the device is connected to IoT Platform.[1626674158.155][LK-0313] MQTT user calls aiot_mqtt_connect api, connect [1626674158.155][LK-0317] LightSwitch&a1wP****** [1626674158.155][LK-0318] 613F70F16BC4C08B7FDC5BA2F9698B37B428B1C3BF5E1F0E4DAFE9B3EA****** core_sysdep_network_establish host iot-06******.mqtt.iothub.aliyuncs.com port 443, type 0 establish tcp connection with server(host='iot-06******.mqtt.iothub.aliyuncs.com', port=[443]) success to establish tcp, fd=3 local port: 32774 [1626674158.177][LK-1000] establish mbedtls connection with server(host='iot-06******.mqtt.iothub.aliyuncs.com', port=[443]) [1626674158.244][LK-1000] success to establish mbedtls connection, (cost 44947 bytes in total, max used 47859 bytes) [1626674158.244][LK-0319] a1wP******.LightSwitch|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=2,signmethod=hmacsha256,ext=3,_conn=tls_5b| [1626674158.299][LK-0313] MQTT connect success in 145 ms AIOT_MQTTEVT_CONNECT
Update device tags
- Logs about downstream response
[1626674158.355][LK-0309] pub: /sys/a1wP******/LightSwitch/thing/deviceinfo/update_reply [LK-030A] < 7B 22 63 6F 64 65 22 3A 32 30 30 2C 22 64 61 74 | {"code":200,"dat [LK-030A] < 61 22 3A 7B 7D 2C 22 69 64 22 3A 22 31 22 2C 22 | a":{},"id":"1"," [LK-030A] < 6D 65 73 73 61 67 65 22 3A 22 73 75 63 63 65 73 | message":"succes [LK-030A] < 73 22 2C 22 6D 65 74 68 6F 64 22 3A 22 74 68 69 | s","method":"thi [LK-030A] < 6E 67 2E 64 65 76 69 63 65 69 6E 66 6F 2E 75 70 | ng.deviceinfo.up [LK-030A] < 64 61 74 65 22 2C 22 76 65 72 73 69 6F 6E 22 3A | date","version": [LK-030A] < 22 31 2E 30 22 7D | "1.0"} pk: a1wP******, dn: LightSwitch, code: 200, msg id: 1, data: {}, message: success
- Logs about downstream response
Delete device tags
Request logs
[1626687770.800][LK-0309] pub: /sys/a1wP******/LightSwitch/thing/deviceinfo/delete [LK-030A] > 7B 22 69 64 22 3A 22 31 22 2C 22 76 65 72 73 69 | {"id":"1","versi [LK-030A] > 6F 6E 22 3A 22 31 2E 30 22 2C 22 70 61 72 61 6D | on":"1.0","param [LK-030A] > 73 22 3A 5B 7B 22 61 74 74 72 4B 65 79 22 3A 22 | s":[{"attrKey":" [LK-030A] > 74 65 73 74 4B 65 79 22 7D 5D 7D | testKey"}]} aiot_devinfo_send delete msg id: 1
- Logs about downstream response
[1626687770.844][LK-0309] pub: /sys/a1wP******/LightSwitch/thing/deviceinfo/delete_reply [LK-030A] < 7B 22 63 6F 64 65 22 3A 32 30 30 2C 22 64 61 74 | {"code":200,"dat [LK-030A] < 61 22 3A 7B 7D 2C 22 69 64 22 3A 22 31 22 2C 22 | a":{},"id":"1"," [LK-030A] < 6D 65 73 73 61 67 65 22 3A 22 73 75 63 63 65 73 | message":"succes [LK-030A] < 73 22 2C 22 6D 65 74 68 6F 64 22 3A 22 74 68 69 | s","method":"thi [LK-030A] < 6E 67 2E 64 65 76 69 63 65 69 6E 66 6F 2E 64 65 | ng.deviceinfo.de [LK-030A] < 6C 65 74 65 22 2C 22 76 65 72 73 69 6F 6E 22 3A | lete","version": [LK-030A] < 22 31 2E 30 22 7D | "1.0"} pk: a1wP******, dn: LightSwitch, code: 200, msg id: 1, data: {}, message: success
IoT Platform logs
Log on to the IoT Platform console to view the device status and operation logs. You can also view submitted device tags and device tag-specific logs.
Device status
In the left-side navigation pane, choose . Then, find the device and view the device status. If the value in the State/Enabled column is Online, the device is connected to IoT Platform.Device tags
In the device list, find the device and click View in the Actions column. You can view device tags on the Device Details page.- Update tags
- Delete tags
Operation logs
In the left-side navigation pane, choose view the logs generated when you submit or delete device tags. . Select a product to