Google Chat 앱의 오류 로그 쿼리
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 가이드에서는 Google Cloud 로그 탐색기에서 Chat 앱 오류 로그를 쿼리하는 방법을 설명합니다. 다음과 같은 작업을 위해 로그를 쿼리합니다.
- 사용자에게 오류가 발생하는지 확인합니다.
- 오류가 얼마나 자주 발생하는지, 가장 자주 발생하는 오류는 무엇인지 확인합니다.
- 오류를 수정하는 데 도움이 되는 설명 오류 메시지와 로그 데이터를 읽습니다.
기본 요건
- Google Chat에 액세스할 수 있는 Google Workspace 계정
- Chat 앱. Chat 앱을 빌드하려면 이 빠른 시작을 따르세요.
- Chat 앱의 오류 로깅을 사용 설정합니다.
오류 로그 쿼리
Google Cloud 콘솔에서 메뉴
menu
> 제품 더보기
> Logging
> 로그 탐색기를 클릭합니다.
로그 탐색기로 이동
필요한 경우 쿼리 빌더를 표시하려면 쿼리 표시를 사용 설정합니다.
Chat 앱 오류 로그의 경우 다음 쿼리를 입력합니다.
severity=ERROR
resource.type="chat.googleapis.com/Project"
최근 오류를 확인하려면 쿼리 실행을 클릭합니다. 또는 오류가 발생할 때 확인하려면 스트림 로그를 클릭합니다. Chat 앱 오류 로그가 '쿼리 결과' 창에 표시됩니다.
Google Cloud 로그 탐색기 및 쿼리 작성에 대해 자세히 알아보려면 로그 탐색기 문서의 다음 가이드를 참고하세요.
로그에서 오류 메시지 읽기
오류 로그를 쿼리한 후 로그를 설명하는 JSON 페이로드로 구성된 개별 로그를 볼 수 있습니다. Chat 앱 오류의 경우 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"
}
고려사항
Google Cloud 로그 탐색기에서 Chat 앱 오류 로그를 사용할 때는 다음 사항을 고려하세요.
Google Chat 앱의 경우 로그 탐색기에는 현재 오작동하는 앱의 문제를 해결하는 데 도움이 되는 다음 심각도의 로그가 포함되어 있습니다.
관련 서비스의 로그도 Chat 앱을 디버깅하는 데 도움이 될 수 있습니다. 예를 들어 Google Cloud Functions를 사용하여 Chat 앱을 배포하는 경우 Cloud Functions 로그에 대해 로그 탐색기를 확인하는 것이 좋습니다.
오류 메시지는 항상 영어로 작성됩니다.
Cloud Logging에는 비용이 발생합니다. Cloud Logging 가격 책정에 대한 자세한 내용은 Google Cloud 운영 제품군 가격 책정을 참고하세요.
오류 로그를 쿼리한 후 오류가 발견되면 다음 가이드를 참고하여 오류를 수정하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-04(UTC)
[null,null,["최종 업데이트: 2025-08-04(UTC)"],[[["\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)"]]