Bird
0
0

A user tries this command:

medium📝 Troubleshoot Q7 of 15
GCP - Cloud Monitoring and Logging
A user tries this command:
gcloud logging write my-log "Test log entry" --severity=INFO
But the log entry does not appear. What is likely wrong?
ASeverity must be ERROR or higher to write logs
BThe log name must be prefixed with 'projects/[PROJECT_ID]/logs/'
CThe message must be in JSON format
DThe command requires a --resource flag
Step-by-Step Solution
Solution:
  1. Step 1: Understand log naming conventions

    Log names must be fully qualified with 'projects/[PROJECT_ID]/logs/[LOG_ID]' to be accepted.
  2. Step 2: Check other options

    Severity INFO is valid; message can be plain text; --resource is optional with defaults.
  3. Final Answer:

    The log name must be prefixed with 'projects/[PROJECT_ID]/logs/' -> Option B
  4. Quick Check:

    Log name requires full project prefix [OK]
Quick Trick: Use full log name with project prefix when writing logs [OK]
Common Mistakes:
  • Using short log names without project prefix
  • Thinking severity limits writing
  • Assuming message must be JSON

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes