Google Cloud Professional Cloud DevOps Engineer — Question 141

Your Cloud Run application writes unstructured logs as text strings to Cloud Logging. You want to convert the unstructured logs to JSON-based structured logs. What should you do?

Answer options

Correct answer: A

Explanation

The correct answer is A because modifying the application to use the Cloud Logging SDK allows for structured logging with a jsonPayload field, which is specifically designed for this purpose. Options B and D suggest using additional components or configurations that may not directly achieve the conversion to structured logs as effectively as the SDK. Option C is incorrect as it involves a log agent that is not necessary when the SDK can handle the logging requirements.