View a markdown version of this page

建立事件日誌組態 - 的受管整合 AWS IoT Device Management

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

建立事件日誌組態

使用 CreateEventLogConfiguration API 動作來啟用資源類型的事件記錄。我們建議為每個資源類型建立單獨的組態,使用 *作為資源識別符來擷取該類型所有資源的日誌。從ERROR日誌層級開始,接收所有失敗日誌,而不會產生過多的磁碟區或成本。

aws iot-managed-integrations create-event-log-configuration \ --resource-type "managed-thing" \ --resource-id "*" \ --event-log-level "ERROR"

針對每個資源類型重複此步驟:

aws iot-managed-integrations create-event-log-configuration \ --resource-type "credential-locker" \ --resource-id "*" \ --event-log-level "ERROR" aws iot-managed-integrations create-event-log-configuration \ --resource-type "provisioning-profile" \ --resource-id "*" \ --event-log-level "ERROR" aws iot-managed-integrations create-event-log-configuration \ --resource-type "ota-task" \ --resource-id "*" \ --event-log-level "ERROR" aws iot-managed-integrations create-event-log-configuration \ --resource-type "account-association" \ --resource-id "*" \ --event-log-level "ERROR"

呼叫 後CreateEventLogConfiguration,日誌會推送到 CloudWatch /aws/iotmanagedintegrations/EventLog Logs 中的日誌群組。使用 ListEventLogConfigurations 來檢視所有組態,或使用 GetEventLogConfiguration 依 ID 擷取特定組態。