Google Associate Cloud Engineer Question 302
Single answerGoogle Cloud PlatformAs a Google Cloud Associate Cloud Engineer, you're tasked with monitoring and troubleshooting a web application running on Google Cloud. You need to filter logs to find specific error messages that occur in the Compute Engine instances running your application. Which of the following steps should you take in Google Cloud Logging to achieve this?
- A
Navigate to the Logs Explorer in the Cloud Console, and use the query editor to filter logs by resource type and severity level.
- B
Use the gcloud command-line tool to export all logs to a local file and manually search for errors.
- C
Set up a Stackdriver Monitoring alert to automatically email you when an error message appears.
- D
Navigate to the Cloud Storage browser and search for logs in your storage buckets.
Show answer and explanation
Correct answer: A
Explanation
The Logs Explorer in the Cloud Console is designed for viewing, filtering, and analyzing logs. It allows you to customize queries to filter logs based on specific criteria, such as resource type and severity, making it the most effective tool for identifying specific error messages in your application's Compute Engine logs.
- A. Correct.
Using the Logs Explorer in the Cloud Console, you can efficiently filter logs based on resource type, severity level, and other criteria using the query editor, which is the most direct way to find specific logs.
- B. Incorrect.
While the gcloud command-line tool can be used to access logs, exporting all logs to a local file is inefficient for searching specific error messages.
- C. Incorrect.
Stackdriver Monitoring (now part of Google Cloud Monitoring) is useful for setting up alerts, but it doesn't directly allow you to filter and view logs; instead, it's used to monitor log-based metrics.
- D. Incorrect.
Cloud Storage might be used for storing exported logs, but searching logs directly in Cloud Storage is not practical for filtering specific log entries like error messages.