PROFESSIONAL-CLOUD-DEVELOPER · Question #267
PROFESSIONAL-CLOUD-DEVELOPER Question #267: Real Exam Question with Answer & Explanation
The correct answer is B: Update your application to output logs in JSON format, and add the necessary metadata to the. By default, GKE clusters are natively integrated with Cloud Logging (and Monitoring). When you create a GKE cluster, both Monitoring and Cloud Logging are enabled by default. GKE deploys a per-node logging agent that reads container logs, adds helpful metadata, and then sends the
Question
You have an application running on Google Kubernetes Engine (GKE). The application is currently using a logging library and is outputting to standard output. You need to export the logs to Cloud Logging, and you need the logs to include metadata about each request. You want to use the simplest method to accomplish this. What should you do?
Options
- AChange your application's logging library to the Cloud Logging library, and configure your
- BUpdate your application to output logs in JSON format, and add the necessary metadata to the
- CUpdate your application to output logs in CSV format, and add the necessary metadata to the
- DInstall the Fluent Bit agent on each of your GKE nodes, and have the agent export all logs from
Explanation
By default, GKE clusters are natively integrated with Cloud Logging (and Monitoring). When you create a GKE cluster, both Monitoring and Cloud Logging are enabled by default. GKE deploys a per-node logging agent that reads container logs, adds helpful metadata, and then sends the logs to the logs router, which sends the logs to Cloud Logging and any of the Logging sink destinations that you have configured. Cloud Logging stores logs for the duration that you specify or 30 days by default. Because Cloud Logging automatically collects standard output and error logs for containerized processes, you can start viewing your logs as soon as your application is deployed. https://cloud.google.com/blog/products/management-tools/using-logging-your-apps-running- kubernetes-engine
Topics
Community Discussion
No community discussion yet for this question.