گزارشهای خطای درخواست برای برنامههای چت Google
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این راهنما نحوه پرسوجو از گزارشهای خطای برنامه Chat در Google Cloud Logs Explorer را شرح میدهد. گزارش های درخواست به:
- بیاموزید که آیا کاربران با خطا مواجه می شوند.
- ببینید چند وقت یکبار خطاها اتفاق میافتند و کدام یک بیشتر هستند.
- پیام های خطای توصیفی و داده های گزارش را بخوانید که به شما در رفع خطاها کمک می کند.
پیش نیازها
گزارش های خطای پرس و جو
در کنسول Google Cloud، menu > محصولات بیشتر > ورود به سیستم > Logs Explorer کلیک کنید.
به Log Explorer بروید
در صورت لزوم، برای نمایش سازنده پرس و جو، Show query را روشن کنید.
برای گزارش های خطای برنامه چت، عبارت زیر را وارد کنید:
severity=ERROR
resource.type="chat.googleapis.com/Project"
برای مشاهده خطاهای اخیر، روی اجرای پرس و جو کلیک کنید. یا برای دیدن خطاها در حین وقوع، روی گزارشهای جریان کلیک کنید. گزارش های خطای برنامه چت در قسمت «نتایج پرس و جو» ظاهر می شود.
برای کسب اطلاعات بیشتر در مورد Google Cloud Logs Explorer و نوشتن عبارتهای جستجو، به این راهنماها در مستندات Logs Explorer مراجعه کنید:
پیام خطا را از یک گزارش بخوانید
پس از جستجوی گزارش خطا، میتوانید گزارشهای جداگانه را مشاهده کنید که شامل یک بار JSON است که گزارش را توصیف میکند. برای خطاهای برنامه گپ، JSON شامل پیام خطا در jsonPayload.error.message
است. به عنوان مثال، در گزارش نمونه زیر، پیام خطا می گوید که یک تابع Apps Script اجرا نشد:
JSON
{
"insertId": "INSERT_ID",
"jsonPayload": {
"@type": "type.googleapis.com/google.chat.logging.v1.ChatAppLogEntry",
"error": {
"code": 9,
"message": "An Apps Script function failed to execute. To review AppsScript error logs, see \"Logging\" (https://developers.google.com/apps-script/guides/logging)."
},
"deployment": "DEPLOYMENT_ID"
},
"resource": {
"type": "chat.googleapis.com/Project",
"labels": {
"project_id": "PROJECT_ID"
}
},
"timestamp": "2022-12-06T05:24:18.697255Z",
"severity": "ERROR",
"logName": "projects/PROJECT_ID/logs/chat.googleapis.com%2Ferrors",
"receiveTimestamp": "2022-12-06T05:24:19.207936968Z"
}
ملاحظات
هنگام کار با گزارش های خطای برنامه Chat در Google Cloud Logs Explorer، به این نکات توجه داشته باشید:
برای برنامههای چت Google، Logs Explorer در حال حاضر شامل گزارشهایی با شدتهای زیر است که به عیبیابی یک برنامه ناکارآمد کمک میکند:
گزارشهای سرویسهای مرتبط نیز میتوانند به اشکالزدایی یک برنامه چت کمک کنند. برای مثال، اگر یک برنامه چت با استفاده از Google Cloud Functions مستقر شده است، بهتر است Logs Explorer را برای گزارشهای Cloud Functions نیز بررسی کنید.
پیام های خطا همیشه به زبان انگلیسی نوشته می شوند.
Cloud Logging هزینه دارد. برای اطلاعات بیشتر در مورد قیمتگذاری Cloud Logging، به قیمتگذاری مجموعه عملیات Google Cloud مراجعه کنید.
پس از جستجو در گزارش های خطا، در صورت یافتن خطا، راهنمای زیر را برای کمک به رفع خطاها مشاهده کنید:
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-04 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-04 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis guide explains how to use Google Cloud Logs Explorer to query error logs for your Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eBy querying logs, you can identify, understand the frequency of, and troubleshoot errors within your Chat app using descriptive error messages and log data.\u003c/p\u003e\n"],["\u003cp\u003eError logs can be queried using a specific query within Logs Explorer and examined for details such as error messages within their JSON payload.\u003c/p\u003e\n"],["\u003cp\u003eWhen using Cloud Logging, keep in mind potential costs and that logs related to other services used by your app may also be helpful for debugging.\u003c/p\u003e\n"]]],["To query Chat app error logs, access Google Cloud Logs Explorer and use the query `severity=ERROR resource.type=\"chat.googleapis.com/Project\"`. This allows you to identify user-encountered errors, their frequency, and view descriptive error messages. Click \"Run query\" for recent errors or \"Stream logs\" for live updates. Each error log contains a JSON payload, with the error message found under `jsonPayload.error.message`. Note that logs with `ERROR` severity are included and all error messages are in English.\n"],null,["This guide describes how to query Chat app error logs in [Google Cloud Logs Explorer](https://cloud.google.com/logging/docs/view/logs-viewer-interface). Query logs to:\n\n- Learn if users encounter errors.\n- See how often errors occur, and which are most frequent.\n- Read descriptive error messages and log data that help you fix the errors.\n\nPrerequisites\n\n- A Google Workspace account with access to Google Chat.\n- A Chat app. To build a Chat app, follow this [quickstart](/workspace/chat/quickstart/gcf-app).\n- [Turn on error logging](/workspace/chat/turn-on-error-logging) for the Chat app.\n\nQuery error logs\n\n1. In the Google Cloud console, click **Menu**\n menu\n \\\u003e **More products**\n \\\u003e **Logging**\n \\\u003e **Logs Explorer**.\n\n [Go to Log Explorer](https://console.cloud.google.com/logs/query)\n2. If necessary, to show the query builder, turn on **Show query**.\n\n3. For Chat app error logs, enter the following query:\n\n severity=ERROR\n resource.type=\"chat.googleapis.com/Project\"\n\n4. To see recent errors, click **Run query** . Or, to see errors as they occur, click **Stream logs**. Chat app error logs appear in the \"Query results\" pane.\n\nTo learn more about Google Cloud Logs Explorer and writing queries, see these guides in the Logs Explorer documentation:\n\n- [View logs by using the Logs Explorer](https://cloud.google.com/logging/docs/view/logs-viewer-interface)\n- [Build queries in the Logs Explorer](https://cloud.google.com/logging/docs/view/building-queries)\n\nRead an error message from a log\n\nAfter querying an error log, you can view individual logs which consist of a JSON payload describing the log. For Chat app errors, the JSON includes the error message at `jsonPayload.error.message`. For example, in the following sample log, the error message says that an Apps Script function failed to execute: \n\nJSON \n\n {\n \"insertId\": \"\u003cvar translate=\"no\"\u003eINSERT_ID\u003c/var\u003e\",\n \"jsonPayload\": {\n \"@type\": \"type.googleapis.com/google.chat.logging.v1.ChatAppLogEntry\",\n \"error\": {\n \"code\": 9,\n \"message\": \"An Apps Script function failed to execute. To review AppsScript error logs, see \\\"Logging\\\" (https://developers.google.com/apps-script/guides/logging).\"\n },\n \"deployment\": \"\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e\"\n },\n \"resource\": {\n \"type\": \"chat.googleapis.com/Project\",\n \"labels\": {\n \"project_id\": \"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\"\n }\n },\n \"timestamp\": \"2022-12-06T05:24:18.697255Z\",\n \"severity\": \"ERROR\",\n \"logName\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/chat.googleapis.com%2Ferrors\",\n \"receiveTimestamp\": \"2022-12-06T05:24:19.207936968Z\"\n }\n\nConsiderations\n\nAs you work with Chat app error logs in Google Cloud Logs Explorer, take note of these considerations:\n\n- For Google Chat apps, Logs Explorer currently includes logs with the following severities which help troubleshoot a malfunctioning app:\n\n - `ERROR`\n\n Logs of related services can also help debug a Chat app. For example, if a Chat app is deployed using [Google Cloud Functions](https://cloud.google.com/functions/docs), then it's a best practice to check Logs Explorer for Cloud Functions logs too.\n- Error messages are always written in English.\n\n- Cloud Logging incurs a cost. For further information on Cloud Logging pricing, refer to [Google Cloud's operations suite pricing](https://cloud.google.com/stackdriver/pricing).\n\nRelated topics\n\nAfter querying error logs, if you find errors, see the following guides for help fixing errors:\n\n- [Learn how to fix Google Chat app errors](/workspace/chat/troubleshoot-chat-apps) like \"App is not responding\", \"Google Chat API is only available to Google Workspace users\", or \"Users can be excluded from spaces\".\n- [Learn how to fix card errors](/workspace/chat/troubleshoot-cards) like card messages, dialogs, or link previews not rendering or working as expected.\n- [Learn how to debug.](/workspace/chat/debug-apps)"]]