

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

# 使用 CloudWatch 日志的代码示例 AWS SDKs
<a name="service_code_examples"></a>

以下代码示例展示了如何将 CloudWatch 日志与 AWS 软件开发套件 (SDK) 配合使用。

*操作*是大型程序的代码摘录，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

*场景*是向您展示如何通过在一个服务中调用多个函数或与其他 AWS 服务服务结合来完成特定任务的代码示例。

有关 S AWS DK 开发者指南和代码示例的完整列表，请参阅[在 AWS SDK 中使用 CloudWatch 日志](sdk-general-information-section.md)。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。

**Contents**
+ [基本功能](service_code_examples_basics.md)
  + [操作](service_code_examples_actions.md)
    + [`AssociateKmsKey`](example_cloudwatch-logs_AssociateKmsKey_section.md)
    + [`CancelExportTask`](example_cloudwatch-logs_CancelExportTask_section.md)
    + [`CreateExportTask`](example_cloudwatch-logs_CreateExportTask_section.md)
    + [`CreateLogGroup`](example_cloudwatch-logs_CreateLogGroup_section.md)
    + [`CreateLogStream`](example_cloudwatch-logs_CreateLogStream_section.md)
    + [`DeleteLogGroup`](example_cloudwatch-logs_DeleteLogGroup_section.md)
    + [`DeleteSubscriptionFilter`](example_cloudwatch-logs_DeleteSubscriptionFilter_section.md)
    + [`DescribeExportTasks`](example_cloudwatch-logs_DescribeExportTasks_section.md)
    + [`DescribeLogGroups`](example_cloudwatch-logs_DescribeLogGroups_section.md)
    + [`DescribeLogStreams`](example_cloudwatch-logs_DescribeLogStreams_section.md)
    + [`DescribeSubscriptionFilters`](example_cloudwatch-logs_DescribeSubscriptionFilters_section.md)
    + [`GetLogEvents`](example_cloudwatch-logs_GetLogEvents_section.md)
    + [`GetQueryResults`](example_cloudwatch-logs_GetQueryResults_section.md)
    + [`PutSubscriptionFilter`](example_cloudwatch-logs_PutSubscriptionFilter_section.md)
    + [`StartLiveTail`](example_cloudwatch-logs_StartLiveTail_section.md)
    + [`StartQuery`](example_cloudwatch-logs_StartQuery_section.md)
+ [场景](service_code_examples_scenarios.md)
  + [配置 Amazon ECS 服务 Connect](example_ecs_ServiceConnect_085_section.md)
  + [创建您的第一个 Lambda 函数](example_lambda_GettingStarted_019_section.md)
  + [运行大型查询](example_cloudwatch-logs_Scenario_BigQuery_section.md)
  + [使用计划的事件调用 Lambda 函数](example_cross_LambdaScheduledEvents_section.md)