[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eThis page outlines how to access and use logs within Google Cloud Observability for various Healthcare API request types, such as DICOM and FHIR operations.\u003c/p\u003e\n"],["\u003cp\u003eErrors generated during DICOM/FHIR/HL7v2 import/export and de-identification processes, as well as dataset de-identification, are automatically logged in Cloud Logging without needing manual activation.\u003c/p\u003e\n"],["\u003cp\u003eLogs can be accessed via the Logs Explorer, and error logs for specific operations can be viewed through the Cloud Healthcare API browser by selecting the "View details in Cloud Logging" option under the operation actions.\u003c/p\u003e\n"],["\u003cp\u003eCloud Logging allows filtering logs by data store type, region, and dataset, and you can search for specific resource types like \u003ccode\u003ehealthcare_dicom_store\u003c/code\u003e to view relevant logs.\u003c/p\u003e\n"],["\u003cp\u003eCloud Healthcare API logs include general details, error codes, messages, operation information, and resource details, aiding in the debugging of requests.\u003c/p\u003e\n"]]],[],null,["# Viewing error logs in Cloud Logging\n\nThis page explains how to view logs in Google Cloud Observability for supported\nrequest types.\n\nLogging\n-------\n\nErrors triggered in each of the following requests are logged to\n[Cloud Logging](/logging/docs).\n\n- [DICOM de-identification](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.dicomStores/deidentify)\n- [DICOM export](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.dicomStores/export)\n- [DICOM import](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.dicomStores/import)\n- [Dataset de-identification](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets/deidentify)\n- [FHIR de-identification](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores/deidentify)\n- [FHIR export](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores/export)\n- [FHIR import](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores/import)\n- [HL7v2 export](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.hl7V2Stores/export)\n- [HL7v2 import](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.hl7V2Stores/import)\n\nErrors are also logged if a Pub/Sub message can't be published to\nPub/Sub. See [Troubleshooting Pub/Sub notifications](/healthcare-api/docs/how-tos/pubsub#troubleshooting) for more information.\n\nLogging is automatic and doesn't need to be enabled. To disable\nCloud Logging for one or all monitored resources, see\n[Logs exclusions](/logging/docs/exclusions).\n\n### Viewing logs\n\nTo view all logs, go to the [Logs Explorer](https://console.cloud.google.com/logs).\n\nTo view logs for operations with an error status, follow these steps:\n\n1. In the Google Cloud console, go to the Cloud Healthcare API browser.\n\n [Go to the Cloud Healthcare API browser](https://console.cloud.google.com/healthcare/browser)\n2. Select a dataset.\n\n3. Click the **Operations** tab.\n\n4. In the list of operations, choose **View details in Cloud Logging** from the **Actions** list to view the details of an erroneous operation.\n\n### Filtering logs\n\nYou can filter logs by data store type, region, and dataset.\n\nFor example, to view logs for FHIR stores, click **Healthcare FHIR Store** in\nthe first list under **Filter by label or text search** . You can also search by\nresource type. For example, searching for `healthcare_dicom_store` displays\nall logs generated for operations with `resource.type` set to\n`healthcare_dicom_store`.\n\n[UTF-8](https://en.wikipedia.org/wiki/UTF-8) encoding\nis enforced for log fields. Characters that aren't UTF-8 characters are replaced\nwith question marks.\n\nFor detailed information about the Logs Explorer, see\n[Using the Logs Explorer](/logging/docs/view/logs-explorer-interface).\n\n### Using Cloud Logging to find error events\n\nYou can also use Cloud Logging to find the audit log of an event causing\nan error. To find a error event in the audit logs, do the following:\n\n1. Search Cloud Logging for the operation that caused.\n\n2. Using the operation's log details, re-run the specific command.\n\n3. View the audit logs for the corresponding event. For more information on audit logs, see [Viewing Cloud Audit Logs](/healthcare-api/docs/how-tos/audit-logging).\n\n### What is logged\n\nCloud Healthcare API log entries contain the following types of information\nfor debugging requests:\n\n- General information, such as severity, project ID, project number, and timestamp.\n- `jsonPayload` contains the actual body of the entry. This field contains the error code, the error message, and the name of the source file whose import triggered the error.\n- `operation` contains the type and ID of the operation that produced the error.\n- `resource` contains the location, dataset, and data store involved in the error.\n\nIf the number of errors exceeds a threshold, a limited number of errors appears\nin Cloud Logging. The threshold is dynamically calculated based on the size\nof the input.\n\n### Where logs are stored\n\nGoogle Cloud Observability isn't a regionalized product. Logs written to\nGoogle Cloud Observability could be stored in a different region from the data stores.\n\n### Sample DICOM import log entry\n\nThe following sample log entry shows an `empty DICOM instance found` error that\noccurred while attempting to import\n`gs://`\u003cvar translate=\"no\"\u003eDICOM_FILENAME\u003c/var\u003e`.dcm` to\n`projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/datasets/`\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e`/dicomStores/`\u003cvar translate=\"no\"\u003eDICOM_STORE_ID\u003c/var\u003e. \n\n```\n jsonPayload: {\n @type: \"type.googleapis.com/google.cloud.healthcare.logging.ImportDicomLogEntry\"\n error: {\n code: 3\n message: \"empty DICOM instance found\"\n }\n source: \"gs://DICOM_FILENAME.dcm\"\n }\n logName: \"projects/PROJECT_ID/logs/healthcare.googleapis.com%2Foperations\"\n operation: {\n id: \"PROJECT_ID\"\n producer: \"import_dicom\"\n }\n receiveTimestamp: \"TIMESTAMP\"\n resource: {\n labels: {\n dataset_id: \"DATASET_ID\"\n dicom_store_id: \"DICOM_STORE_ID\"\n location: \"LOCATION\"\n project_id: \"PROJECT_ID\"\n }\n type: \"healthcare_dicom_store\"\n }\n severity: \"ERROR\"\n timestamp: \"TIMESTAMP\"\n```\n\n### Sample FHIR import log entry\n\nThe following sample log entry shows a `cannot import resource` error that\noccurred while attempting to import\n`gs://`\u003cvar translate=\"no\"\u003eFHIR_FILENAME\u003c/var\u003e`.ndjson` to\n`projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/datasets/`\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e`/fhirStore/`\u003cvar translate=\"no\"\u003eFHIR_STORE_ID\u003c/var\u003e. \n\n```\n jsonPayload: {\n @type: \"type.googleapis.com/google.cloud.healthcare.logging.ImportFhirLogEntry\"\n error: {\n code: 3\n message: \"cannot import resource Patient/PATIENT_ID, conflicting resource already exists\"\n }\n source: \"gs://FHIR_FILENAME.ndjson\"\n }\n logName: \"projects/PROJECT_ID/logs/healthcare.googleapis.com%2Foperations\"\n operation: {\n id: \"PROJECT_ID\"\n producer: \"import_fhir\"\n }\n receiveTimestamp: \"TIMESTAMP\"\n resource: {\n labels: {\n dataset_id: \"DATASET_ID\"\n fhir_store_id: \"FHIR_STORE_ID\"\n location: \"LOCATION\"\n project_id: \"PROJECT_ID\"\n }\n type: \"healthcare_fhir_store\"\n }\n severity: \"ERROR\"\n timestamp: \"TIMESTAMP\"\n```\n\n### Sample DICOM de-identify log entry\n\nThe following sample log entry shows a `cannot de-identify dicom instance` error\nthat occurred while trying to de-identify DICOM instance \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\nin dataset\n`projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/datasets/`\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e. \n\n```\n jsonPayload: {\n @type: \"type.googleapis.com/google.cloud.healthcare.logging.DeidentifyLogEntry\"\n error: {\n code: 2\n message: \"Failed to process instance INSTANCE_ID\"\n }\n resourceName: \"projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID\"\n }\n logName: \"projects/PROJECT_ID/logs/healthcare.googleapis.com%2Fdeidentify_dataset\"\n operation: {\n id: \"projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID\"\n producer: \"healthcare.googleapis.com/DeidentifyDataset\"\n }\n receiveTimestamp: \"TIMESTAMP\"\n resource: {\n labels: {\n dataset_id: \"DATASET_ID\"\n location: \"LOCATION\"\n project_id: \"PROJECT_ID\"\n }\n type: \"healthcare_dataset\"\n }\n severity: \"ERROR\"\n timestamp: \"TIMESTAMP\"\n```\n\nWhat's next\n-----------\n\n- Review the [conceptual information about Cloud Healthcare API](/healthcare-api/docs/concepts/introduction)\n- Review the [conceptual information about Cloud Logging](/logging/docs/overview)"]]