Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Saat add-on Google Workspace yang dipublikasikan menampilkan error, antarmuka add-on akan menampilkan pesan umum "Terjadi error saat menjalankan add-on". Namun, error ini dicatat ke Cloud Logs Explorer.
Panduan ini menjelaskan cara membuat kueri log error add-on di Cloud Logs Explorer, sehingga Anda dapat:
Pelajari apakah pengguna mengalami error.
Lihat seberapa sering error terjadi, dan error mana yang paling sering terjadi.
Baca pesan error deskriptif yang membantu Anda memperbaikinya.
Untuk melihat error terbaru, klik Run query. Atau, untuk melihat error saat terjadi, klik Log streaming. Log error add-on muncul di panel "Hasil kueri".
Untuk informasi lebih lanjut tentang Cloud Logs Explorer dan cara menulis kueri, lihat referensi berikut:
[null,null,["Terakhir diperbarui pada 2024-12-22 UTC."],[[["\u003cp\u003eGoogle Workspace add-ons log errors to Cloud Logs Explorer, providing detailed error messages for troubleshooting.\u003c/p\u003e\n"],["\u003cp\u003eTo view these logs, enable the Cloud Logging API, publish your add-on, and then query the logs using the provided instructions and query.\u003c/p\u003e\n"],["\u003cp\u003eYou can control error logging behavior through the \u003ccode\u003eexceptionLogging\u003c/code\u003e setting in your add-on's manifest file.\u003c/p\u003e\n"],["\u003cp\u003eRemember that only errors are logged, messages are in English, and Cloud Logging usage may incur costs.\u003c/p\u003e\n"]]],["Published Google Workspace add-on errors are logged in Cloud Logs Explorer, offering detailed insights beyond the generic interface message. To access these logs, enable the \"Cloud Logging API\" and publish the add-on. Query logs in the Logs Explorer using `severity\u003e=ERROR` and `protoPayload.serviceName=\"gsuiteaddons.googleapis.com\"`. Error logging is enabled by default, controlled via the `exceptionLogging` key in the manifest file. Only errors are logged, messages are always in English, and Cloud Logging incurs costs.\n"],null,["# Query error logs for Google Workspace add-ons\n\nWhen a published Google Workspace add-on returns an error, the\nadd-on interface returns a generic message of\n\"Something went wrong when executing the add-on.\" However, these errors are\nlogged to [Cloud Logs Explorer](https://cloud.google.com/logging/docs/view/logs-viewer-interface).\n| **Note:** For Apps Script, if your add-on is deployed as a test, then errors are reported in both the Cloud Logs Explorer and in the add-on interface.\n|\n|\n| For example, an add-on test deployment might display an\n| error message like this in its interface: `TypeError:\n| card.INVALIDFUNCTIONNAME\n| is not a function [line: 33, function: getContextualAddOn, file:\n| GetContextualAddOn]`.\n|\n|\n| Although error messages like this are helpful, additional information is\n| available in the Logs Explorer. As a best practice, query the error logs for\n| more information. For further information about testing\n| add-on deployments, refer to\n| [Test and debug Google Workspace add-ons](/workspace/add-ons/guides/debug).\n\nThis guide describes how to query add-on error logs in\nCloud Logs Explorer, so you can:\n\n- Learn if users encounter errors.\n- See how often errors occur, and which are most frequent.\n- Read descriptive error messages that help you fix them.\n\nPrerequisites\n-------------\n\nBefore querying add-on error logs:\n\n- Enable the \"Cloud Logging API\" in the add-on's Google Cloud project. To enable an API, refer to [Create a Cloud project and enable the API](/workspace/guides/create-project).\n- Publish the add-on on Google Workspace Marketplace. To publish an add-on on the Marketplace, refer to [Publish an app](/workspace/marketplace/how-to-publish).\n\nQuery add-on error logs\n-----------------------\n\nTo get logs for an add-on:\n\n1. Open the [Google Cloud console](https://console.cloud.google.com/).\n2. Next to \"Google Cloud Platform,\" click the Down arrow arrow_drop_down and select the add-on project.\n3. In the top-left corner, click Menu menu \\\u003e **Logging**. The Logs Explorer opens.\n4. For add-on error logs, in the query builder, enter\n the following query:\n\n severity\u003e=ERROR\n protoPayload.serviceName=\"gsuiteaddons.googleapis.com\"\n\n5. To see recent errors, click **Run query** . Or, to see errors as they\n occur, click **Stream logs**. Add-ons error logs appear in the\n \"Query results\" pane.\n\nFor further information about Cloud Logs Explorer and writing queries, refer to\nthe following:\n\n- [Use the Logs Explorer](https://cloud.google.com/logging/docs/view/logs-viewer-interface)\n- [Build queries](https://cloud.google.com/logging/docs/view/building-queries)\n\nEnable or disable error logging\n-------------------------------\n\nBy default, error logging is enabled. When error logging is enabled, the\n[manifest file](/workspace/add-ons/concepts/workspace-manifests)\nhas the following: \n\n \"exceptionLogging\": \"STACKDRIVER\",\n\nTo disable error logging, replace\n`\"exceptionLogging\": \"STACKDRIVER\",` with the following line in the\nmanifest file: \n\n // Disable error logging\n \"exceptionLogging\": \"NONE\"\n\nTo re-enable error logging, replace `\"exceptionLogging\": \"NONE\"` with\n`\"exceptionLogging\": \"STACKDRIVER\",`.\n\nConsiderations\n--------------\n\nAs you work with add-on error logs in Cloud Logs\nExplorer, take note of these considerations:\n\n- Add-ons only log errors in Logs Explorer. Other log types are not recorded.\n- Error messages are always written in English.\n- Cloud Logging incurs a cost. For further information about Cloud Logging pricing, refer to [Google Cloud Observability pricing](https://cloud.google.com/stackdriver/pricing)."]]