Désactiver et activer les journaux des changements d'état
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Par défaut, Compute Engine enregistre les changements d'état de votre groupe d'instances géré lorsque vous configurez une vérification d'état basée sur l'application. Toutefois, vous pouvez désactiver les journaux si vous souhaitez réduire les coûts de journalisation ou si vous n'avez pas besoin de journaliser les changements d'état d'intégrité.
Sur la ligne du bucket de journaux _Default, cliquez sur le menu more_vert, puis sélectionnez Modifier le récepteur.
Dans la section Choisir des journaux à exclure du récepteur, cliquez sur Ajouter une exclusion.
Dans le champ Nom du filtre d'exclusion, spécifiez un nom pour votre filtre.
Créez le filtre d'exclusion suivant :
logName="projects/PROJECT_ID/logs/compute.googleapis.com%2Finstance_group_manager_events" AND
jsonPayload.instanceHealthStateChange:"*"
Pour enregistrer les modifications, cliquez sur Mettre à jour le récepteur.
Une fois les modifications enregistrées, Compute Engine commence à filtrer les journaux de changement d'état de l'instance. Pour en savoir plus, consultez les sections Gérer les récepteurs et Créer des filtres d'exclusion.
Activer les journaux de changement d'état
Vous pouvez activer les journaux de changement d'état d'instance précédemment désactivés ou supprimer le filtre d'exclusion que vous avez ajouté pour désactiver les journaux.
Console
Pour activer la journalisation des changements d'état, procédez comme suit :
Accédez à la page Routeur de journaux dans la console Google Cloud .
Sur la ligne du bucket de journaux _Default, cliquez sur le menu more_vert, puis sélectionnez Modifier le récepteur.
Dans la section Choisir des journaux à exclure du récepteur, cliquez sur Désactiver à côté du filtre d'exclusion qui filtre les journaux de changement d'état de l'instance. Vous pouvez également Supprimer le filtre d'exclusion si vous n'en avez plus besoin.
Cliquez sur Mettre à jour le récepteur pour enregistrer les modifications.
Une fois les modifications enregistrées, Compute Engine commence à journaliser les changements d'état Pour plus d'informations sur les entrées de journal, consultez la section Format des entrées de journal.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (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)."]]