Disabling and enabling health state change logs


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.

For logs of load balancer health checks, see load balancer's health check logging.

Before you begin

Disabling health state change logs

To disable the health state change logs, use the Logs exclusions to create an exclusion filter that discards the logs.

Console

  1. Go to the Logs Router page in the Google Cloud console.

    Go to Logs Router

  2. In the _Default logging bucket row, click the menu and then select Edit sink.

  3. In the Choose logs to filter out of sink section, click Add exclusion.

  4. In the Exclusion filter name field, specify a name for your filter.

  5. Build the following exclusion filter:

    logName="projects/PROJECT_ID/logs/compute.googleapis.com%2Finstance_group_manager_events" AND
    jsonPayload.instanceHealthStateChange:"*"
    
  6. 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:

  1. Go to the Logs Router page in the Google Cloud console.

    Go to Logs Router

  2. In the _Default logging bucket row, click the menu and then select Edit sink.

  3. 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.

  4. 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.

To learn more, see Managing sinks and Removing exclusions.

What's next