By default, Compute Engine logs health state changes of your managed instance
group when you configure application-based health check
for the group. However, you can disable the logs if you want to reduce the
logging costs or don't have any specific requirement to log the health state
changes.
In the _Default logging bucket row, click the
more_vert menu
and then select Edit sink.
In the Choose logs to filter out of sink section, click Add exclusion.
In the Exclusion filter name field, specify a name for your filter.
Build the following exclusion filter:
logName="projects/PROJECT_ID/logs/compute.googleapis.com%2Finstance_group_manager_events" AND
jsonPayload.instanceHealthStateChange:"*"
To save the changes, click Update sink.
After you save the changes, Compute Engine begins to filter out the instance
health state change logs. To learn more, see Managing sinks
and Creating exclusion filters.
Enabling health state change logs
You can enable any previously disabled instance health state change logs or
remove the exclusion filter that you added earlier to
disable the logs.
Console
To enable health state change logging, do the following:
Go to the Logs Router page in the Trusted Cloud console.
In the _Default logging bucket row, click the
more_vert menu
and then select Edit sink.
In the Choose logs to filter out of sink section, click Disable
next to the exclusion filter that filters out instance health state
change logs. You can also Delete the exclusion filter if you no longer
need it.
Click Update sink to save the changes.
After you save the changes, Compute Engine begins to log the health
state changes. For more information about log entries, see
Format of log entries.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 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,["*** ** * ** ***\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- Read the [Logs exclusion](/logging/docs/exclusions) documentation.\n- Review the [Cloud Logging pricing](/stackdriver/pricing).\n\nDisabling health state change logs\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\nConsole\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\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\nConsole\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- [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)."]]