Google Associate Cloud Engineer Question 295
Select 2Google Cloud PlatformYour company has multiple projects in Google Cloud, and you want to consolidate all logs into a single log bucket for centralized analysis. How can you configure your log router to achieve this?
- A
Create a log sink in each project that routes logs to the centralized log bucket.
- B
Set up a log sink only in the centralized project that automatically pulls logs from other projects.
- C
Ensure the centralized log bucket is located in the same region as the source logs to avoid latency.
- D
Use Cloud Logging API to export logs directly from each project to the centralized log bucket.
Show answer and explanation
Correct answers: A, D
Explanation
To consolidate logs into a single bucket from multiple Google Cloud projects, you need to set up log sinks in each project. Each sink will export logs to the centralized log bucket. Alternatively, the Cloud Logging API can be used to export logs, allowing for more customized control over the log exportation process.
- A. Correct.
Correct. You need to create a log sink in each project to route the logs to the centralized log bucket. This is how you aggregate logs from multiple sources.
- B. Incorrect.
Incorrect. Log sinks push logs to a destination rather than pulling them, so you cannot set up a sink in the centralized project to pull logs from other projects.
- C. Incorrect.
Incorrect. While having resources in the same region may reduce latency, configuring log buckets and routers does not inherently depend on the regional locality of the logs.
- D. Correct.
Correct. Using the Cloud Logging API is a valid way to programmatically export logs from each project to a centralized log bucket.