Google Cloud DevOps Certification Practice Test

Session length

1 / 20

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?

Create a Pub/Sub topic and configure a logging sink to send logs to the topic.

Create a storage bucket and appropriate VPC firewall rules to save logs.

Create a logs bucket with a logging sink and set retention to 365 days.

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

Get further explanation with Examzify DeepDiveBeta

Store logs locally in each application and provide manual backup procedures.

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy