

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# イベントログ設定の作成
<a name="logging-create-config"></a>

[CreateEventLogConfiguration](https://docs.aws.amazon.com/iot-mi/latest/APIReference/API_CreateEventLogConfiguration.html) 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 Logs の`/aws/iotmanagedintegrations/EventLog`ロググループにプッシュされます。[ListEventLogConfigurations](https://docs.aws.amazon.com/iot-mi/latest/APIReference/API_ListEventLogConfigurations.html) を使用してすべての設定を表示するか、[GetEventLogConfiguration](https://docs.aws.amazon.com/iot-mi/latest/APIReference/API_GetEventLogConfiguration.html) を使用して ID で特定の設定を取得します。