

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Membuat konfigurasi log peristiwa
<a name="logging-create-config"></a>

Gunakan tindakan [CreateEventLogConfiguration](https://docs.aws.amazon.com/iot-mi/latest/APIReference/API_CreateEventLogConfiguration.html)API untuk mengaktifkan pencatatan peristiwa untuk jenis sumber daya. Sebaiknya buat konfigurasi terpisah untuk setiap jenis sumber daya, gunakan `*` sebagai pengidentifikasi sumber daya untuk menangkap log untuk semua sumber daya jenis itu. Mulai dari tingkat `ERROR` log untuk menerima semua log kegagalan tanpa menghasilkan volume atau biaya yang berlebihan.

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

Ulangi untuk setiap jenis sumber daya:

```
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"
```

Setelah Anda menelepon`CreateEventLogConfiguration`, log didorong ke grup `/aws/iotmanagedintegrations/EventLog` log di CloudWatch Log. Gunakan [ListEventLogConfigurations](https://docs.aws.amazon.com/iot-mi/latest/APIReference/API_ListEventLogConfigurations.html)untuk melihat semua konfigurasi, atau [GetEventLogConfiguration](https://docs.aws.amazon.com/iot-mi/latest/APIReference/API_GetEventLogConfiguration.html)untuk mengambil konfigurasi tertentu berdasarkan ID.