Menonaktifkan dan mengaktifkan log perubahan status respons
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Secara default, Compute Engine mencatat perubahan status respons grup instance terkelola ke dalam log saat Anda mengonfigurasi health check berbasis aplikasi untuk grup tersebut. Namun, Anda dapat menonaktifkan log ini jika ingin mengurangi biaya logging atau tidak memiliki persyaratan khusus untuk mencatat perubahan status respons ke dalam log.
Di baris bucket logging _Default, klik menu more_vert, lalu pilih Edit sink.
Di bagian Choose logs to filter out of sink, klik Add exception.
Di kolom Nama filter pengecualian, tentukan nama untuk filter Anda.
Buat filter pengecualian berikut:
logName="projects/PROJECT_ID/logs/compute.googleapis.com%2Finstance_group_manager_events" AND
jsonPayload.instanceHealthStateChange:"*"
Untuk menyimpan perubahan, klik Perbarui sink.
Setelah Anda menyimpan perubahan, Compute Engine akan mulai memfilter log perubahan status respons instance. Untuk mempelajari lebih lanjut, lihat Mengelola sink dan Membuat filter pengecualian.
Mengaktifkan log perubahan status respons
Anda dapat mengaktifkan log perubahan status respons instance yang sebelumnya dinonaktifkan atau menghapus filter pengecualian yang Anda tambahkan sebelumnya untuk menonaktifkan log.
Konsol
Untuk mengaktifkan logging perubahan status respons, lakukan hal berikut:
Di baris bucket logging _Default, klik menu more_vert, lalu pilih Edit sink.
Di bagian Choose logs to filter out of sink, klik Disable
di samping filter pengecualian yang memfilter log perubahan
status respons instance. Anda juga dapat Menghapus filter pengecualian jika tidak lagi
memerlukannya.
Klik Update sink untuk menyimpan perubahan.
Setelah Anda menyimpan perubahan, Compute Engine akan mulai mencatat perubahan status respons. Untuk mengetahui informasi selengkapnya tentang entri log, lihat
Format entri log.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 UTC."],[[["\u003cp\u003eCompute Engine, by default, logs health state changes of managed instance groups when application-based health checks are configured, but these logs can be disabled.\u003c/p\u003e\n"],["\u003cp\u003eDisabling health state change logs can be achieved by creating an exclusion filter in the Logs Router, using a specific filter targeting \u003ccode\u003ecompute.googleapis.com%2Finstance_group_manager_events\u003c/code\u003e and \u003ccode\u003ejsonPayload.instanceHealthStateChange\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo re-enable previously disabled health state change logs, you can disable or delete the corresponding exclusion filter in the Logs Router.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine will start or stop logging health state changes for managed instance groups immediately upon updating the exclusion filter settings.\u003c/p\u003e\n"]]],[],null,["# Disabling and enabling health state change logs\n\n*** ** * ** ***\n\nBy default, Compute Engine logs health state changes of your managed instance\ngroup when you configure application-based [health check](/compute/docs/instance-groups/autohealing-instances-in-migs#setting_up_an_autohealing_policy)\nfor the group. However, you can disable the logs if you want to reduce the\nlogging costs or don't have any specific requirement to log the health state\nchanges.\n\nFor logs of load balancer health checks, see [load balancer's health check logging](/load-balancing/docs/health-check-logging).\n\nBefore you begin\n----------------\n\n- Read the [Logs exclusion](/logging/docs/exclusions) documentation.\n- Review the [Cloud Logging pricing](/stackdriver/pricing).\n\nDisabling health state change logs\n----------------------------------\n\nTo disable the health state change logs, use the [Logs exclusions](/logging/docs/exclusions)\nto create an exclusion filter that discards the logs. \n\n### Console\n\n1. Go to the **Logs Router** page in the Google Cloud console.\n\n [Go to Logs Router](https://console.cloud.google.com/logs/router)\n2. In the `_Default` logging bucket row, click the\n *more_vert* menu\n and then select **Edit sink**.\n\n3. In the **Choose logs to filter out of sink** section, click **Add exclusion**.\n\n4. In the **Exclusion filter name** field, specify a name for your filter.\n\n5. Build the following exclusion filter:\n\n ```\n logName=\"projects/PROJECT_ID/logs/compute.googleapis.com%2Finstance_group_manager_events\" AND\n jsonPayload.instanceHealthStateChange:\"*\"\n ```\n6. To save the changes, click **Update sink**.\n\n After you save the changes, Compute Engine begins to filter out the instance\n health state change logs. To learn more, see [Managing sinks](/logging/docs/export/configure_export_v2#managing_sinks)\n and [Creating exclusion filters](/logging/docs/exclusions#create-filter-existing).\n\nEnabling health state change logs\n---------------------------------\n\nYou can enable any previously disabled instance health state change logs or\nremove the exclusion filter that you added earlier to\n[disable the logs](#disabling_health_state_change_logs). \n\n### Console\n\nTo enable health state change logging, do the following:\n\n1. Go to the **Logs Router** page in the Google Cloud console.\n\n [Go to Logs Router](https://console.cloud.google.com/logs/router)\n2. In the `_Default` logging bucket row, click the\n *more_vert* menu\n and then select **Edit sink**.\n\n3. In the **Choose logs to filter out of sink** section, click **Disable**\n next to the exclusion filter that filters out instance health state\n change logs. You can also **Delete** the exclusion filter if you no longer\n need it.\n\n | **Note:** Check all your exclusion filters because the same log entries could be targeted by more than one filter.\n4. Click **Update sink** to save the changes.\n\n After you save the changes, Compute Engine begins to log the health\n state changes. For more information about log entries, see\n [Format of log entries](/compute/docs/instance-groups/monitoring-managed-instance-health-state-changes#what_is_logged).\n\nTo learn more, see [Managing sinks](/logging/docs/export/configure_export_v2#managing_sinks)\nand [Removing exclusions](/logging/docs/exclusions#stopping-resource).\n\nWhat's next\n-----------\n\n- [Monitoring managed instance health state changes](/compute/docs/instance-groups/monitoring-managed-instance-health-state-changes)\n- [What makes a good autohealing health check](/compute/docs/instance-groups/autohealing-instances-in-migs#what_makes_a_good_autohealing_health_check)."]]