로그 항목을 저장하는 모든 로그 버킷에서 고객 관리 암호화 키 (CMEK)가 사용 중지되었습니다. Error Reporting은 CMEK가 사용 설정된 로그 버킷에 로그 항목을 저장할 수 없습니다. 로그 버킷의 CMEK 구성을 확인하는 방법은 키 사용 설정 확인을 참조하세요.
로그 버킷이 다음 중 하나를 충족합니다.
로그 항목이 시작된 동일한 프로젝트에 로그 버킷이 저장되어 있습니다.
로그 항목이 프로젝트로 라우팅된 후 프로젝트가 해당 로그 항목을 소유 로그 버킷에 저장했습니다.
구성한 싱크 목록을 보려면 다음 명령어를 실행합니다.
gcloud logging sinks list
이 명령어는 다음과 유사한 출력을 반환합니다.
NAME DESTINATION FILTER
_Default logging.googleapis.com/projects/my-team-project/locations/global/buckets/_Default NOT LOG_ID("cloudaudit.googleapis.com/activity") AND NOT LOG_ID("externalaudit.googleapis.com/activity") AND NOT LOG_ID("cloudaudit.googleapis.com/system_event") AND NOT LOG_ID("externalaudit.googleapis.com/system_event") AND NOT LOG_ID("cloudaudit.googleapis.com/access_transparency") AND NOT LOG_ID("externalaudit.googleapis.com/access_transparency")
_Required logging.googleapis.com/projects/my-team-project/locations/global/buckets/_Required LOG_ID("cloudaudit.googleapis.com/activity") OR LOG_ID("externalaudit.googleapis.com/activity") OR LOG_ID("cloudaudit.googleapis.com/system_event") OR LOG_ID("externalaudit.googleapis.com/system_event") OR LOG_ID("cloudaudit.googleapis.com/access_transparency") OR LOG_ID("externalaudit.googleapis.com/access_transparency")
logs-from-samples logging.googleapis.com/projects/my-team-project/locations/global/buckets/sample-bucket (empty filter)
regional_logs logging.googleapis.com/projects/my-team-project/locations/europe-west1/buckets/bucket_for_regional_logs (empty filter)
test-logs logging.googleapis.com/projects/team-b-project/locations/global/buckets/test-bucket (empty filter)
이 예시에서 로그 항목의 소스 Google Cloud 프로젝트는 my-team-project입니다. 결과는 다음과 같습니다.
로그 버킷은 로그 항목을 라우팅하는 동일한 프로젝트에 의해 저장되기 때문에 Error Reporting은 _Default, _Required, logs-from-samples 싱크가 라우팅하는 로그 항목을 분석할 수 있습니다.
my-team-project의 싱크가 로그 항목을 다른 프로젝트의 로그 버킷으로 라우팅하기 때문에 Error Reporting은 test-logs라는 로그 버킷에 저장된 로그 항목을 분석할 수 없습니다.
이 섹션에서는 오류 데이터가 Cloud Logging 버킷에 기록될 때 문제 해결 지원을 제공하고 Error Reporting을 사용하여 해당 로그 버킷을 자동으로 분석합니다.
샘플 로그 항목 생성
프로젝트 설정을 확인하기 위해 다음 gcloud 명령어를 사용하여 Error Reporting에서 선택할 로그 항목을 프로그래매틱 방식으로 생성할 수 있습니다.
gcloudloggingwrite--payload-type=jsontest-errors-log\
'{"serviceContext":{"service":"manual-testing"},"message":"Test Error\n at /test.js:42:42","context":{"httpRequest":{"url":"/test","method":"GET","responseStatusCode":500}}}'
다음 gcloud 명령어를 사용하여 Error Reporting에 테스트 오류를 보고할 수 있습니다.
gcloudbetaerror-reportingeventsreport--serviceManual--service-versiontest1\--message"java.lang.TestError: msg at com.example.TestClass.test(TestClass.java:51) at com.example.AnotherClass(AnotherClass.java:25)"
cURL 명령어를 사용하여 REST API 호출을 테스트할 수 있습니다. 다음 명령어를 보내기 전에 PROJECT_ID 및 API_KEY를 올바른 값으로 바꿉니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-11(UTC)"],[[["\u003cp\u003eError Reporting analyzes log entries if Assured Workloads and Customer-Managed Encryption Keys (CMEK) are disabled, and the log bucket is in the same project as the log entries or routed to a project that stores them.\u003c/p\u003e\n"],["\u003cp\u003eIf using CMEK-enabled log buckets, utilize Error Reporting client libraries or the API, and verify project settings by generating a sample log entry via the \u003ccode\u003egcloud\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eConfirm log entries follow the expected format, as detailed in the documentation, by checking a log entry with exception data in Cloud Logging.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the Error Reporting API, ensure it is enabled and send test errors using \u003ccode\u003egcloud\u003c/code\u003e commands or cURL, and verify that the exception data sent by the application is in the correct format with required attributes.\u003c/p\u003e\n"],["\u003cp\u003eIf a stack trace is not captured by Error Reporting, ensure that \u003ccode\u003ejsonPayload\u003c/code\u003e does not contain \u003ccode\u003estack_trace\u003c/code\u003e or \u003ccode\u003eexception\u003c/code\u003e fields, and that the stack trace format is one of the supported programming language formats.\u003c/p\u003e\n"]]],[],null,["If your application errors are not showing up in Error Reporting,\nthen use the following steps to troubleshoot.\n\nBefore you begin\n\n1. Verify that Error Reporting can analyze your log entries.\n\n Error Reporting is a global service built on\n Cloud Logging and can analyze log entries when all of the following are true:\n\n - Assured workloads are disabled. For more information, see [Overview of Assured Workloads](/assured-workloads/docs/overview).\n - [Customer-managed encryption keys (CMEK)](/logging/docs/routing/managed-encryption-storage) are disabled on all log buckets that store the log entry. Error Reporting can't store log entries in log buckets that have CMEK enabled. For information about how to determine the CMEK configuration for a log bucket, see [Verify key enablement](/logging/docs/routing/managed-encryption-storage#verify-key).\n - The log bucket satisfies one of the following:\n - The log bucket is stored in the same project where the log entries originated.\n - The log entries were routed to a project, and then that project stored those log entries in a log bucket that it owns.\n\n \u003cbr /\u003e\n\n To see a list of sinks you have configured, run the following command: \n\n gcloud logging sinks list\n\n The command returns an output similar to the following: \n\n NAME DESTINATION FILTER\n _Default logging.googleapis.com/projects/my-team-project/locations/global/buckets/_Default NOT LOG_ID(\"cloudaudit.googleapis.com/activity\") AND NOT LOG_ID(\"externalaudit.googleapis.com/activity\") AND NOT LOG_ID(\"cloudaudit.googleapis.com/system_event\") AND NOT LOG_ID(\"externalaudit.googleapis.com/system_event\") AND NOT LOG_ID(\"cloudaudit.googleapis.com/access_transparency\") AND NOT LOG_ID(\"externalaudit.googleapis.com/access_transparency\")\n _Required logging.googleapis.com/projects/my-team-project/locations/global/buckets/_Required LOG_ID(\"cloudaudit.googleapis.com/activity\") OR LOG_ID(\"externalaudit.googleapis.com/activity\") OR LOG_ID(\"cloudaudit.googleapis.com/system_event\") OR LOG_ID(\"externalaudit.googleapis.com/system_event\") OR LOG_ID(\"cloudaudit.googleapis.com/access_transparency\") OR LOG_ID(\"externalaudit.googleapis.com/access_transparency\")\n logs-from-samples logging.googleapis.com/projects/my-team-project/locations/global/buckets/sample-bucket (empty filter)\n regional_logs logging.googleapis.com/projects/my-team-project/locations/europe-west1/buckets/bucket_for_regional_logs (empty filter)\n test-logs logging.googleapis.com/projects/team-b-project/locations/global/buckets/test-bucket (empty filter)\n\n In this example, the source Google Cloud project of the log entries is\n `my-team-project`. As a result:\n - Error Reporting can analyze the log entries routed by the `_Default`, `_Required`, and `logs-from-samples` sinks because the log bucket is stored by the same project that routes the log entries.\n - Error Reporting can't analyze the log entries stored in the log bucket named `test-logs` because the sink in `my-team-project` routes the log entries to a log bucket in a different project.\n2. Ensure that you have the\n [Google Cloud CLI installed](/sdk/docs/install#installation_instructions).\n\n3. Ensure that you have the\n [`beta` component enabled for the gcloud CLI](/sdk/docs/components#alpha_and_beta_components).\n\nWhen using logs\n\nThis section provides troubleshooting support when your error data is written\nto Cloud Logging buckets, and you rely on Error Reporting\nto automatically analyze those log buckets.\n\nGenerate a sample log entry\n\nTo confirm your project settings, you can programmatically generate a log entry\nthat will be picked up by Error Reporting with the following `gcloud`\ncommand: \n\n gcloud logging write --payload-type=json test-errors-log \\\n '{\"serviceContext\":\n {\"service\": \"manual-testing\"},\n \"message\": \"Test Error\\n at /test.js:42:42\",\n \"context\": {\"httpRequest\":\n {\"url\": \"/test\",\"method\": \"GET\",\"responseStatusCode\": 500}}}'\n\nThen open [Error Reporting](https://console.cloud.google.com/errors) and confirm\nthat you see the newly created error.\n\nConfirm the log entry format\n\nNavigate to the [Cloud Logging page](https://console.cloud.google.com/logs) and locate\na log entry that contains exception data sent from your application.\n\nConfirm that the log entry uses the\n[expected format](/error-reporting/docs/formatting-error-messages).\n\nWhen using the Error Reporting API\n\n1.\n\n\n Enable the required API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=clouderrorreporting.googleapis.com)\n2. Send a test error\n\n Try sending an error to the service manually.\n\n You can report a test error to Error Reporting using the following\n `gcloud` command: \n\n gcloud beta error-reporting events report --service Manual --service-version test1 \\\n --message \"java.lang.TestError: msg\n at com.example.TestClass.test(TestClass.java:51)\n at com.example.AnotherClass(AnotherClass.java:25)\"\n\n You can use a cURL command to test your REST API calls. Replace\n `PROJECT_ID` and `API_KEY` with your valid values before sending the following\n command: \n\n curl -X POST -H \"Content-Type: application/json\" \\\n -d '{\"message\":\"java.lang.TestError: msg\\n\\tat com.example.TestClass.test(TestClass.java:51)\\n\\tat com.example.AnotherClass(AnotherClass.java:25)\",\"serviceContext\":{\"service\":\"manual-testing\"}}' \\\n https://clouderrorreporting.googleapis.com/v1beta1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/events:report?key=\u003cvar translate=\"no\"\u003eAPI_KEY\u003c/var\u003e\n\n3. Confirm the sent payload\n\n Ensure that your application is sending exception data to the API in the\n [correct format](/error-reporting/docs/formatting-error-messages) and that it\n contains the required attributes.\n\nA stack trace is logged but not recognized by Error Reporting\n\nYou log an error by using the `message` field of a `jsonPayload`, and you expect\nError Reporting to capture the error. However, the error data\nisn't captured.\n\nTo resolve this failure, try the following:\n\n- Ensure that the `jsonPayload` doesn't include a `stack_trace` or `exception`\n field. When those fields are present, the `message` field isn't evaluated.\n\n- Ensure that the structure of the stack trace is in\n [one of the supported programming language formats](/error-reporting/reference/rest/v1beta1/projects.events/report#ReportedErrorEvent).\n The stack trace isn't captured by Error Reporting\n when an unsupported format is used.\n\nFor more information, see\n[Format errors in logs](/error-reporting/docs/formatting-error-messages)."]]