If you need to maintain logs for one year from client applications in Cloud Run and Cloud Functions with minimal code changes, what should you implement?

Study for the Google Cloud DevOps Certification Test. Prepare with interactive quizzes and detailed explanations. Enhance your skills and boost your confidence!

Implementing a logs bucket with a logging sink and setting the retention to 365 days is the most effective solution for maintaining logs from client applications in Cloud Run and Cloud Functions. This approach seamlessly integrates with Google Cloud’s logging services and provides an automated way to collect, manage, and archive logs without necessitating significant changes to the application code.

Using a logging sink allows you to define where logs are directed, in this case, to a dedicated log storage bucket. By setting the retention policy to 365 days, logs will be automatically stored for one year, which meets the compliance and auditing requirements often needed for client applications.

This method also supports the scalability and reliability of the Google Cloud environment, as it offloads the responsibility of log management to the cloud infrastructure, allowing developers to focus on application functionality. All of this can be achieved with a minimal code footprint while adhering to best practices for log management in cloud-native systems.

Other choices, while they may have their own uses, do not offer the same level of integration and efficiency when it comes to log retention and management. For instance, using a Pub/Sub topic may complicate the setup, as it is more suited for real-time event streaming rather than long-term log storage. Creating a storage

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy