Step 2: Configure Log Routing
Navigate to your Cloud SQL instance, click on "View PostgreSQL error logs", and then click on "Logs Router".
Click "Create Sink", and select your Pub/Sub topic. Make sure that the left side is actually showing PostgreSQL logs (as it does in this screenshot), and that you don't have a different type of resource selected:

Navigate to the Logs Router screen under the Logging service. Click "Create Sink" and select your Pub/Sub topic as the destination.
To filter for AlloyDB log events, specify an inclusion filter in the following format, replacing MYCLUSTER with your cluster name:
resource.type="alloydb.googleapis.com/Instance" resource.labels.cluster_id="MYCLUSTER"
After you’ve saved the new sink, we now need to create a service account that can access the logs sent to the Pub/Sub topic.
Continue to Step 3: Set up Service Account
Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →