Cloud Logging collects and stores logs from various sources in Google Cloud Platform. What is its main purpose?
Think about what logs are used for in software systems.
Cloud Logging is designed to collect and manage logs to help monitor and troubleshoot applications and services.
Run the following command to list log entries for a project:
gcloud logging read "resource.type=gae_app" --limit 1 --format json
What type of output will this command produce?
The command uses --format json and --limit 1 with a filter on resource type.
The command reads one log entry matching the filter and outputs it as a JSON array.
You want to export logs from Cloud Logging to a Cloud Storage bucket named my-logs-bucket. Which YAML snippet correctly defines this sink?
Cloud Storage destinations use the gs:// prefix.
To export logs to Cloud Storage, the destination must start with gs:// followed by the bucket name.
You created a sink to export logs to a BigQuery dataset, but no logs appear in the dataset. What is the most likely cause?
Check permissions for the sink's service account on the destination.
If the sink's service account does not have write permissions on the BigQuery dataset, logs cannot be exported.
Arrange the steps in the correct order to create a sink that exports logs to a Pub/Sub topic and verify it works.
Think about resource creation, permission granting, and verification order.
You must first create the Pub/Sub topic, then create the sink pointing to it, grant permissions, and finally verify logs arrive.