This document describes audit logging for Google Health API. Google Cloud services
generate audit logs that record administrative and access activities within your Google Cloud resources.
For more information about Cloud Audit Logs, see the following:

- [Types of audit logs](https://cloud.google.com/logging/docs/audit#types)
- [Audit log entry structure](https://cloud.google.com/logging/docs/audit#audit_log_entry_structure)
- [Storing and routing audit logs](https://cloud.google.com/logging/docs/audit#storing_and_routing_audit_logs)
- [Cloud Logging pricing summary](https://cloud.google.com/stackdriver/pricing#logs-pricing-summary)
- [Enable Data Access audit logs](https://cloud.google.com/logging/docs/audit/configure-data-access)

<br />

## Service name

Google Health API audit logs use the service name `health.googleapis.com`.
Filter for this service:

```
    protoPayload.serviceName="health.googleapis.com"
  
```

<br />

## Methods by permission type

Each IAM permission has a `type` property, whose value is an enum
that can be one of four values: `ADMIN_READ`, `ADMIN_WRITE`,
`DATA_READ`, or `DATA_WRITE`. When you call a method,
Google Health API generates an audit log whose category is dependent on the
`type` property of the permission required to perform the method.

Methods that require an IAM permission with the `type` property value
of `DATA_READ`, `DATA_WRITE`, or `ADMIN_READ` generate
[Data Access](https://cloud.google.com/logging/docs/audit#data-access) audit logs.

Methods that require an IAM permission with the `type` property value
of `ADMIN_WRITE` generate
[Admin Activity](https://cloud.google.com/logging/docs/audit#admin-activity) audit logs.
API methods in the following list that are marked with (LRO) are long-running operations (LROs). These methods usually generate two audit log entries: one when the operation starts and another when it ends. For more information see [Audit logs for long-running operations](https://cloud.google.com/logging/docs/audit/understanding-audit-logs#lro).

| Permission type | Methods |
|---|---|
| `ADMIN_WRITE` | `google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriber` (LRO) `google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscription` `google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriber` (LRO) `google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscription` `google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriber` (LRO) `google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscription` |
| `DATA_READ` | `google.devicesandservices.health.v4.DataSubscriptionService.ListSubscribers` `google.devicesandservices.health.v4.DataSubscriptionService.ListSubscriptions` |

## API interface audit logs

For information about how and which permissions are evaluated for each method,
see the IAM documentation for Google Health API.

### `google.devicesandservices.health.v4.DataSubscriptionService`

The following audit logs are associated with methods belonging to
`google.devicesandservices.health.v4.DataSubscriptionService`.

#### `CreateSubscriber`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriber`  
- **Audit log type** : [Admin activity](https://cloud.google.com/logging/docs/audit#admin-activity)  
- **Permissions** :
  - `health.subscribers.create - META_DATA_WRITE`
- **Method is a long-running or streaming operation** : Yes.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscriber"
  `  

#### `CreateSubscription`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscription`  
- **Audit log type** : [Admin activity](https://cloud.google.com/logging/docs/audit#admin-activity)  
- **Permissions** :
  - `health.subscriptions.create - META_DATA_WRITE`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.CreateSubscription"
  `  

#### `DeleteSubscriber`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriber`  
- **Audit log type** : [Admin activity](https://cloud.google.com/logging/docs/audit#admin-activity)  
- **Permissions** :
  - `health.subscribers.delete - META_DATA_WRITE`
- **Method is a long-running or streaming operation** : Yes.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscriber"
  `  

#### `DeleteSubscription`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscription`  
- **Audit log type** : [Admin activity](https://cloud.google.com/logging/docs/audit#admin-activity)  
- **Permissions** :
  - `health.subscriptions.delete - META_DATA_WRITE`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.DeleteSubscription"
  `  

#### `ListSubscribers`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.ListSubscribers`  
- **Audit log type** : [Data access](https://cloud.google.com/logging/docs/audit#data-access)  
- **Permissions** :
  - `health.subscribers.list - META_DATA_READ`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.ListSubscribers"
  `  

#### `ListSubscriptions`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.ListSubscriptions`  
- **Audit log type** : [Data access](https://cloud.google.com/logging/docs/audit#data-access)  
- **Permissions** :
  - `health.subscriptions.list - META_DATA_READ`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.ListSubscriptions"
  `  

#### `UpdateSubscriber`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriber`  
- **Audit log type** : [Admin activity](https://cloud.google.com/logging/docs/audit#admin-activity)  
- **Permissions** :
  - `health.subscribers.update - META_DATA_WRITE`
- **Method is a long-running or streaming operation** : Yes.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscriber"
  `  

#### `UpdateSubscription`

- **Method** : `google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscription`  
- **Audit log type** : [Admin activity](https://cloud.google.com/logging/docs/audit#admin-activity)  
- **Permissions** :
  - `health.subscriptions.update - META_DATA_WRITE`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="google.devicesandservices.health.v4.DataSubscriptionService.UpdateSubscription"
  `  

## Methods that don't produce audit logs

A method might not produce audit logs for one or more of the following
reasons:

- It is a high volume method involving significant log generation and storage costs.
- It has low auditing value.
- Another audit or platform log already provides method coverage.

<br />

The following methods don't produce audit logs:

- `google.devicesandservices.health.v4.DataSubscriptionService.GetSubscription`