Cette page explique comment trouver et utiliser Cloud Logging pour afficher et interroger les journaux de votre instance de Database Migration Service.
Documentation de référence sur la journalisation de Database Migration Service
Consultez la page Journalisation de la plate-formeGoogle Cloud pour connaître les définitions des noms de fichiers journaux, des ressources surveillées et des charges utiles de Database Migration Service.
Afficher les journaux AlloyDB
Database Migration Service utilise Cloud Logging. Pour en savoir plus, consultez la documentation de Cloud Logging. Vous trouverez ci-dessous un exemple de requête pour afficher les journaux AlloyDB:
Sélectionnez un projet AlloyDB existant en haut de la page.
Dans le générateur de requêtes, ajoutez les éléments suivants :
Ressource: sélectionnez Instance AlloyDB. Dans la boîte de dialogue, sélectionnez un emplacement, puis un ID de cluster.
Noms des journaux: faites défiler la page jusqu'à la section AlloyDB et sélectionnez les fichiers journaux correspondant à votre instance. Par exemple :
alloydb.googleapis.com/postgres.log
Gravité : sélectionnez un niveau de journalisation.
Période : sélectionnez une valeur prédéfinie ou créez une période personnalisée.
gcloud
Exécutez la commande gcloud logging pour afficher les entrées de journal. Dans l'exemple ci-dessous, remplacez PROJECT_ID.
L'option limit est un paramètre facultatif qui indique le nombre maximal d'entrées à renvoyer.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (UTC)."],[[["\u003cp\u003eThis page explains how to access and utilize Cloud Logging for monitoring your Database Migration Service instance.\u003c/p\u003e\n"],["\u003cp\u003eDatabase Migration Service integrates with Cloud Logging, allowing you to view and query logs using the Google Cloud platform.\u003c/p\u003e\n"],["\u003cp\u003eA sample query is provided to view AlloyDB logs within Cloud Logging, targeting specific cluster and instance IDs.\u003c/p\u003e\n"],["\u003cp\u003eYou can view AlloyDB logs through the Logs Explorer in the Google Cloud console by selecting the AlloyDB Instance resource and specifying log files.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud logging read\u003c/code\u003e command can be used to view log entries, with an option to limit the number of entries returned.\u003c/p\u003e\n"]]],[],null,["# Logging\n\n\u003cbr /\u003e\n\n[MySQL](/database-migration/docs/mysql/logging \"View this page for the MySQL version of Database Migration Service.\") \\| [PostgreSQL](/database-migration/docs/postgres/logging \"View this page for the PostgreSQL version of Database Migration Service.\") \\| PostgreSQL to AlloyDB\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nOverview\n--------\n\nThis page describes how to find and use Cloud Logging to view and query logs\nfor your Database Migration Service instance.\n\nDatabase Migration Service logging reference\n--------------------------------------------\n\nSee the [Google Cloud platform logging](/logging/docs/api/platform-logs#cloud_database_migration_service) page for definitions of log file names, monitored resources, and payloads for\nDatabase Migration Service.\n\nView AlloyDB logs\n-----------------\n\nDatabase Migration Service uses Cloud Logging. See the [Cloud Logging documentation](/logging/docs) for complete information. Below is a sample query to view AlloyDB logs: \n\n```sql\nresource.type=\"alloydb.googleapis.com/Instance\"\nresource.labels.cluster_id=\"clust1\"\nresource.labels.instance_id=\"inst1\"\nlogName=\"projects/user1-prod3/logs/alloydb.googleapis.com%2Fpostgres.log\"\n``` \n\n### Console\n\n1. [Go to the Logs Explorer](https://console.cloud.google.com/logs/query)\n2. Select an existing AlloyDB project at the top of the page.\n3. In the Query builder, add the following:\n - Resource: select **AlloyDB Instance**. In the dialog, select a location followed by selection of a cluster ID.\n - Log names: scroll to the AlloyDB section and select appropriate log files for your instance. For example:\n - alloydb.googleapis.com/postgres.log\n - Severity: select a log level.\n - Time range: select a preset or create a custom range.\n\n### gcloud\n\nUse the [`gcloud logging`](/sdk/gcloud/reference/logging/read)\ncommand to view log entries. In the example below, replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e.\nThe [`limit`](/sdk/gcloud/reference/logging/read#--limit)\nflag is an optional parameter that indicates the maximum number of entries to\nreturn. \n\n```bash\ngcloud logging read \"projects/[PROJECT_ID]/logs/alloydb.googleapis.com/postgres.log\" --limit=10\n```"]]