A GKE-hosted application writes logs to stdout and you need those logs exported to Cloud Logging with request metadata. What is the simplest approach?
Choose an answer
Tap an option to check your answer.
Correct answer: Change the application's logging library to the Cloud Logging library and configure it to export logs to Cloud Logging..
Why this is the answer
The simplest approach is to use the Cloud Logging client libraries directly within your application. These libraries are designed to integrate seamlessly with Cloud Logging, automatically capturing and enriching logs with relevant metadata (like request context, trace IDs, and resource information) without requiring manual formatting or external agents. This method leverages native GCP integration for efficient and comprehensive log export. Updating the application to output logs in JSON or CSV format would require manual parsing and enrichment of metadata, which is less efficient and more error-prone than using the dedicated Cloud Logging libraries. Installing Fluent Bit on each GKE node is a valid approach for collecting logs, but it's more complex than directly integrating the Cloud Logging library into the application, especially when the goal is to include application-specific request metadata. Fluent Bit would primarily collect stdout/stderr streams, and enriching them with detailed request metadata would still require application-level changes or complex Fluent Bit configurations.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed