Logging handler for Google Container Engine (GKE).
Formats log messages in a JSON format, so that Kubernetes clusters with the
fluentd Google Cloud plugin installed can format their log messages so that
metadata such as log level is properly captured.
[[["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-07 UTC."],[],[],null,["# Module container_engine (3.12.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.12.1 (latest)](/python/docs/reference/logging/latest/google.cloud.logging_v2.handlers.container_engine)\n- [3.12.0](/python/docs/reference/logging/3.12.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.11.3](/python/docs/reference/logging/3.11.3/google.cloud.logging_v2.handlers.container_engine)\n- [3.10.0](/python/docs/reference/logging/3.10.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.9.0](/python/docs/reference/logging/3.9.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.8.0](/python/docs/reference/logging/3.8.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.7.0](/python/docs/reference/logging/3.7.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.6.0](/python/docs/reference/logging/3.6.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.5.0](/python/docs/reference/logging/3.5.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.4.0](/python/docs/reference/logging/3.4.0/google.cloud.logging_v2.handlers.container_engine)\n- [3.3.1](/python/docs/reference/logging/3.3.1/google.cloud.logging_v2.handlers.container_engine)\n- [3.2.5](/python/docs/reference/logging/3.2.5/google.cloud.logging_v2.handlers.container_engine)\n- [3.1.2](/python/docs/reference/logging/3.1.2/google.cloud.logging_v2.handlers.container_engine)\n- [3.0.0](/python/docs/reference/logging/3.0.0/google.cloud.logging_v2.handlers.container_engine)\n- [2.7.2](/python/docs/reference/logging/2.7.2/google.cloud.logging_v2.handlers.container_engine)\n- [2.6.0](/python/docs/reference/logging/2.6.0/google.cloud.logging_v2.handlers.container_engine)\n- [2.5.0](/python/docs/reference/logging/2.5.0/google.cloud.logging_v2.handlers.container_engine)\n- [2.4.0](/python/docs/reference/logging/2.4.0/google.cloud.logging_v2.handlers.container_engine)\n- [2.3.1](/python/docs/reference/logging/2.3.1/google.cloud.logging_v2.handlers.container_engine)\n- [2.2.0](/python/docs/reference/logging/2.2.0/google.cloud.logging_v2.handlers.container_engine)\n- [2.1.1](/python/docs/reference/logging/2.1.1/google.cloud.logging_v2.handlers.container_engine)\n- [2.0.2](/python/docs/reference/logging/2.0.2/google.cloud.logging_v2.handlers.container_engine)\n- [1.15.3](/python/docs/reference/logging/1.15.3/google.cloud.logging_v2.handlers.container_engine)\n- [1.14.0](/python/docs/reference/logging/1.14.0/google.cloud.logging_v2.handlers.container_engine)\n- [1.13.0](/python/docs/reference/logging/1.13.0/google.cloud.logging_v2.handlers.container_engine)\n- [1.12.1](/python/docs/reference/logging/1.12.1/google.cloud.logging_v2.handlers.container_engine) \nLogging handler for Google Container Engine (GKE).\n\nFormats log messages in a JSON format, so that Kubernetes clusters with the\nfluentd Google Cloud plugin installed can format their log messages so that\nmetadata such as log level is properly captured.\n\nClasses\n-------\n\n### [ContainerEngineHandler](/python/docs/reference/logging/latest/google.cloud.logging_v2.handlers.container_engine.ContainerEngineHandler)\n\n ContainerEngineHandler(*, name=None, stream=None)\n\nHandler to format log messages the format expected by GKE fluent.\n\nThis handler is written to format messages for the Google Container Engine\n(GKE) fluentd plugin, so that metadata such as log level are properly set.\n\nDEPRECATED: use StructuredLogHandler to write formatted logs to standard out instead."]]