Select an existing Cloud SQL project at the top of the page.
In the Query builder, add the following:
Resource: select Cloud SQL Database. In the dialog, select a
Cloud SQL instance.
Log names: scroll to the Cloud SQL section and select
appropriate log files for your instance. For example:
cloudsql.googlapis.com/mysql-general.log
cloudsql.googleapis.com/mysql.err
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-05 UTC."],[[["This page explains how to access and utilize Cloud Logging to monitor logs for your Database Migration Service instances."],["Database Migration Service leverages Cloud Logging, and you can find definitions of log files, resources, and payloads on the Google Cloud platform logging page."],["To view Cloud SQL instance logs, navigate to the Logs Explorer in the Google Cloud console, select your project, resource, and relevant log names."],["You can also view log entries using the `gcloud logging read` command, specifying the project ID and log file name, with an optional limit parameter."],["The Cloud SQL sample queries on the Cloud Logging page can also be used."]]],[]]