Logging

Database Migration Service uses Cloud Logging. See the Cloud Logging documentation for complete information and review the Cloud SQL sample queries.

To view logs for your Cloud SQL for PostgreSQL instance log entries:

Console

  1. Go to Logs Explorer
  2. In the Query tab, use the drop-down menus to compose the following query:
    • Resource: select Cloud SQL Database. In the dialog, select a Cloud SQL for PostgreSQL instance.
    • Log names: scroll to the Cloud SQL for PostgreSQL section and select appropriate log files for your instance. For example:
      • cloudsql.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.

gcloud logging read "projects/[PROJECT_ID]/logs/cloudsql.googleapis.com/postgres.log" --limit=10