

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

# 为现有 AWS Client VPN 端点启用连接日志记录
<a name="create-connection-log-existing"></a>

可以使用控制台或命令行为现有的 Client VPN 端点启用连接日志记录。

**使用控制台为现有的 Client VPN 端点启用连接日志记录**

1. 打开位于 [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) 的 Amazon VPC 控制台。

1. 在导航窗格中，选择 **Client VPN Endpoints**（Client VPN 终端节点）。

1. 选择 Client VPN 终端节点，选择 **Actions**（操作），然后选择 **Modify Client VPN endpoint**（修改 Client VPN 终端节点）。

1. 在 **Connection logging**（连接日志记录）下，开启 **Enable log details on client connections**（在客户端连接上启用日志详细信息）。

1. 在**CloudWatch 日志日志组名称**中，选择 CloudWatch 日志日志组的名称。

1. （可选）在**CloudWatch 日志日志流名称**中，选择 CloudWatch 日志日志流的名称。

1. 选择 **Modify Client VPN endpoint**（修改 Client VPN 终端节点）。

**要为现有 Client VPN 端点启用连接记录，请使用 AWS CLI**  
使用 [modify-client-vpn-endpoint](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-client-vpn-endpoint.html) 命令指定 `--connection-log-options` 参数。您可以按 JSON 格式指定连接日志信息，如以下示例所示。

```
{
    "Enabled": true,
    "CloudwatchLogGroup": "ClientVpnConnectionLogs",
    "CloudwatchLogStream": "NewYorkOfficeVPN"
}
```