Logging


MySQL | PostgreSQL | PostgreSQL to AlloyDB


Overview

This page describes how to find and use Cloud Logging to view and query logs for your Database Migration Service instance.

Database Migration Service logging reference

See the Google Cloud platform logging page for definitions of log file names, monitored resources, and payloads for Database Migration Service.

View AlloyDB logs

Database Migration Service uses Cloud Logging. See the Cloud Logging documentation for complete information. Below is a sample query to view AlloyDB logs:

resource.type="alloydb.googleapis.com/Instance"
resource.labels.cluster_id="clust1"
resource.labels.instance_id="inst1"
logName="projects/user1-prod3/logs/alloydb.googleapis.com%2Fpostgres.log"

Console

  1. Go to the Logs Explorer
  2. Select an existing AlloyDB project at the top of the page.
  3. In the Query builder, add the following:
    • Resource: select AlloyDB Instance. In the dialog, select a location followed by selection of a cluster ID.
    • Log names: scroll to the AlloyDB section and select appropriate log files for your instance. For example:
      • alloydb.googleapis.com/postgres.log
    • Severity: select a log level.
    • Time range: select a preset or create a custom range.

gcloud

Use the gcloud logging command to view log entries. In the example below, replace PROJECT_ID. The limit flag is an optional parameter that indicates the maximum number of entries to return.

gcloudloggingread"projects/[PROJECT_ID]/logs/alloydb.googleapis.com/postgres.log"--limit=10

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月17日 UTC.