Eseguire query sui log degli errori per i componenti aggiuntivi di Google Workspace
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Quando un componente aggiuntivo di Google Workspace pubblicato restituisce un errore, l'interfaccia del componente aggiuntivo restituisce un messaggio generico "Si è verificato un problema durante l'esecuzione del componente aggiuntivo". Tuttavia, questi errori vengono registrati in Esplora log di Cloud.
Questa guida descrive come eseguire query sui log degli errori dei componenti aggiuntivi in
Esplora log di Cloud, in modo da poter:
Scopri se gli utenti riscontrano errori.
Scopri con quale frequenza si verificano gli errori e quali sono i più frequenti.
Leggi messaggi di errore descrittivi che ti aiutano a risolverli.
Prerequisiti
Prima di eseguire query sui log degli errori dei componenti aggiuntivi:
Pubblica il componente aggiuntivo su Google Workspace Marketplace.
Per pubblicare un componente aggiuntivo sul
Marketplace, consulta
Pubblicare un'app.
Esegui query sui log degli errori dei componenti aggiuntivi
Per visualizzare gli errori recenti, fai clic su Esegui query. In alternativa, per visualizzare gli errori man mano che si verificano, fai clic su Avvia flusso di log. I log degli errori dei componenti aggiuntivi vengono visualizzati nel riquadro "Risultati delle query".
Per ulteriori informazioni su Esplora log di Cloud e sulla scrittura di query, consulta quanto segue:
Per impostazione predefinita, la registrazione degli errori è attivata. Quando il logging degli errori è abilitato, il
file manifest
contiene quanto segue:
"exceptionLogging": "STACKDRIVER",
Per disattivare il logging degli errori, sostituisci
"exceptionLogging": "STACKDRIVER", con la seguente riga nel
file manifest:
// Disable error logging"exceptionLogging":"NONE"
Per riattivare il logging degli errori, sostituisci "exceptionLogging": "NONE" con
"exceptionLogging": "STACKDRIVER",.
Considerazioni
Quando utilizzi i log degli errori dei componenti aggiuntivi in Esplora log di Cloud, tieni presente queste considerazioni:
I componenti aggiuntivi registrano gli errori solo in Esplora log. Gli altri tipi di log non vengono registrati.
I messaggi di errore sono sempre scritti in inglese.
Cloud Logging comporta un costo. Per ulteriori informazioni sui prezzi di Cloud Logging, consulta la pagina Prezzi di Google Cloud Observability.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)."]]