Viewing error logs in Cloud Logging

This page explains how to view logs in Google Cloud's operations suite for errors triggered in DICOM import requests and FHIR import and export requests.

Logging

Errors triggered in each of the following requests are logged to Cloud Logging.

Errors are also logged if a Pub/Sub message can't be published to Pub/Sub. See Troubleshooting Pub/Sub notifications for more information.

Logging is automatic and doesn't need to be enabled. To disable Cloud Logging for one or all monitored resources, see Logs exclusions.

Viewing logs

To view all logs, go to the Logs Viewer. To view logs for operations with an error status, click the more information icon for the operation on the OPERATIONS tab in the healthcare browser and then click View details in Stackdriver.

Filtering logs

You can filter logs by store type (DICOM or FHIR store), region, and dataset.

For example, to view logs for FHIR stores, click Healthcare FHIR Store in the first list under Filter by label or text search. You can also search by resource type. For example, searching for healthcare_dicom_store displays all logs generated for operations with resource.type set to healthcare_dicom_store.

UTF-8 encoding is enforced for log fields. Characters that aren't UTF-8 characters are replaced with question marks.

For detailed information about the Logs Viewer, see Viewing logs.

Using Cloud Logging to find error events

You can also use Cloud Logging to find the audit log of an event causing an error. To find a error event in the audit logs, do the following:

  1. Search Cloud Logging for the operation that caused.

  2. Using the operation's log details, re-run the specific command.

  3. View the audit logs for the corresponding event. For more information on audit logs, see Viewing Cloud Audit Logs.

What is logged

Cloud Healthcare API log entries contain the following types of information for debugging requests:

  • General information, such as severity, project ID, project number, and timestamp.
  • 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.
  • operation contains the type and ID of the operation that produced the error.
  • resource contains the location, dataset, and DICOM or FHIR store involved in the error.

If the number of errors exceeds a threshold, a limited number of errors appears in Cloud Logging. The threshold is dynamically calculated based on the size of the input.

Where logs are stored

Google Cloud's operations suite isn't a regionalized product. Logs written to Google Cloud's operations suite could be stored in a different region from the DICOM and FHIR stores.

Sample DICOM import log entry

The following sample log entry shows an empty DICOM instance found error that occurred while attempting to import gs://DICOM_FILENAME.dcm to projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID.

 jsonPayload: {
  @type:  "type.googleapis.com/google.cloud.healthcare.logging.ImportDicomLogEntry"
  error: {
   code:  3
   message:  "empty DICOM instance found"
  }
  source:  "gs://DICOM_FILENAME.dcm"
 }
 logName:  "projects/PROJECT_ID/logs/healthcare.googleapis.com%2Foperations"
 operation: {
  id:  "PROJECT_ID"
  producer:  "import_dicom"
 }
 receiveTimestamp:  "TIMESTAMP"
 resource: {
  labels: {
   dataset_id:  "DATASET_ID"
   dicom_store_id:  "DICOM_STORE_ID"
   location:  "LOCATION"
   project_id:  "PROJECT_ID"
  }
  type:  "healthcare_dicom_store"
 }
 severity:  "ERROR"
 timestamp:  "TIMESTAMP"

Sample FHIR import log entry

The following sample log entry shows a cannot import resource error that occurred while attempting to import gs://FHIR_FILENAME.ndjson to projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStore/FHIR_STORE_ID.

 jsonPayload: {
  @type:  "type.googleapis.com/google.cloud.healthcare.logging.ImportFhirLogEntry"
  error: {
   code:  3
   message:  "cannot import resource Patient/PATIENT_ID, conflicting resource already exists"
  }
  source:  "gs://FHIR_FILENAME.ndjson"
 }
 logName:  "projects/PROJECT_ID/logs/healthcare.googleapis.com%2Foperations"
 operation: {
  id:  "PROJECT_ID"
  producer:  "import_fhir"
 }
 receiveTimestamp:  "TIMESTAMP"
 resource: {
  labels: {
   dataset_id:  "DATASET_ID"
   fhir_store_id:  "FHIR_STORE_ID"
   location:  "LOCATION"
   project_id:  "PROJECT_ID"
  }
  type:  "healthcare_fhir_store"
 }
 severity:  "ERROR"
 timestamp:  "TIMESTAMP"

Sample DICOM de-identify log entry

The following sample log entry shows a cannot de-identify dicom instance error that occurred while trying to de-identify DICOM instance INSTANCE_ID in dataset projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID.

 jsonPayload: {
  @type:  "type.googleapis.com/google.cloud.healthcare.logging.DeidentifyLogEntry"
  error: {
   code:  2
   message:  "Failed to process instance INSTANCE_ID"
  }
  resourceName:  "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID"
 }
 logName:  "projects/PROJECT_ID/logs/healthcare.googleapis.com%2Fdeidentify_dataset"
 operation: {
  id:  "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"
  producer:  "healthcare.googleapis.com/DeidentifyDataset"
 }
 receiveTimestamp:  "TIMESTAMP"
 resource: {
  labels: {
   dataset_id:  "DATASET_ID"
   location:  "LOCATION"
   project_id:  "PROJECT_ID"
  }
  type:  "healthcare_dataset"
 }
 severity:  "ERROR"
 timestamp:  "TIMESTAMP"

What's next