[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[[["\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)."]]