监视器Amazon IoT使用 CloudWatch 日志 - Amazon IoT Core
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

监视器Amazon IoT使用 CloudWatch 日志

如果启用 Amazon IoT 日志记录,则当消息从您的设备通过消息代理和规则引擎传递时,Amazon IoT 会发送关于每条消息的进度事件。在CloudWatch 控制台, CloudWatch 日志出现在名为AWSIotLogs

有关以下内容 CloudWatch 日志,请参阅CloudWatch 日志。有关支持的信息Amazon IoT CloudWatch 日志,请参阅CloudWatch 日志Amazon IoT日志条目

正在查看Amazon IoT登录 CloudWatch 控制台

注意

AWSIotLogsV2日志组在 CloudWatch 控制台直到:

  • 您已在 Amazon IoT 中启用日志记录。有关如何在 Amazon IoT 中启用日志记录的详细信息,请参阅 配置 Amazon IoT 日志记录

  • 一些日志条目已由 Amazon IoT 操作编写。

要查看您的Amazon IoT登录 CloudWatch 控制台
  1. 浏览到 https://console.aws.amazon.com/cloudwatch/。在导航窗格中,选择 Log groups(日志组)

  2. 筛选条件文本框中,输入 AWSIotLogsV2,然后按 Enter。

  3. 双击 AWSIotLogsV2 日志组。

  4. 选择 Search All(搜索全部)。显示为您的账户生成的 Amazon IoT 日志的完整列表。

  5. 选择展开图标可查看单个流。

您也可以在筛选事件文本框中输入查询。可以尝试以下受到较多关注的查询:

  • { $.logLevel = "INFO" }

    查找所有日志级别为 INFO 的日志。

  • { $.status = "Success" }

    查找所有状态为 Success 的日志。

  • { $.status = "Success" && $.eventType = "GetThingShadow" }

    查找所有状态为 Success 且事件类型为 GetThingShadow 的日志。

有关创建筛选表达式的更多信息,请参见CloudWatch 日志查询