<br />

<br />


Cloud Audit Logs for App Engine Memcache let you track administrative and
data-access operations on your resources to help you monitor access and
configuration changes. You can query these logs in the Logs Explorer and
check which App Engine Memcache API methods generate Cloud Audit Logs.

For more information about Cloud Audit Logs,
see the following documents:

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

<br />

## Notes

Audit logs only apply to operations made through Cloud Console. Memcache operations initiated within your app will not be audit logged.

## Service name

To view the App Engine Memcache audit logs, do the following:

1. In the Google Cloud console, go to the Logs Explorer page:

   [Go to Logs Explorer](https://console.cloud.google.com/logs/query)
2. Copy and paste the following query into the **Query** field of the
   Logs Explorer, and then click **Run query**.

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

## Methods by permission type

> [!NOTE]
> To enable these data access audit logs, you must enable data access audit logs for `appengine.googleapis.com`.

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,
App Engine Memcache 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://docs.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://docs.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://docs.cloud.google.com/logging/docs/audit/understanding-audit-logs#lro).

| Permission type | Methods |
|---|---|
| `DATA_READ` | `cloud_cache.MemcacheAdminService.GetMemcacheItem` |
| `DATA_WRITE` | `cloud_cache.MemcacheAdminService.DeleteMemcacheItem` `cloud_cache.MemcacheAdminService.FlushAllMemcacheItems` `cloud_cache.MemcacheAdminService.SetMemcacheItem` |

## API interface audit logs

For information about how and which permissions are evaluated for each method,
see the Identity and Access Management documentation for App Engine Memcache.

### `cloud_cache.MemcacheAdminService`

The following audit logs are associated with methods belonging to
`cloud_cache.MemcacheAdminService`.

#### `DeleteMemcacheItem`

- **Method** : `cloud_cache.MemcacheAdminService.DeleteMemcacheItem`  
- **Audit log type** : [Data access](https://docs.cloud.google.com/logging/docs/audit#data-access)  
- **Permissions** :
  - `appengine.memcache.update - DATA_WRITE`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="cloud_cache.MemcacheAdminService.DeleteMemcacheItem"
  `  

#### `FlushAllMemcacheItems`

- **Method** : `cloud_cache.MemcacheAdminService.FlushAllMemcacheItems`  
- **Audit log type** : [Data access](https://docs.cloud.google.com/logging/docs/audit#data-access)  
- **Permissions** :
  - `appengine.memcache.flush - DATA_WRITE`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="cloud_cache.MemcacheAdminService.FlushAllMemcacheItems"
  `  

#### `GetMemcacheItem`

- **Method** : `cloud_cache.MemcacheAdminService.GetMemcacheItem`  
- **Audit log type** : [Data access](https://docs.cloud.google.com/logging/docs/audit#data-access)  
- **Permissions** :
  - `appengine.memcache.get - DATA_READ`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="cloud_cache.MemcacheAdminService.GetMemcacheItem"
  `  

#### `SetMemcacheItem`

- **Method** : `cloud_cache.MemcacheAdminService.SetMemcacheItem`  
- **Audit log type** : [Data access](https://docs.cloud.google.com/logging/docs/audit#data-access)  
- **Permissions** :
  - `appengine.memcache.addKey - DATA_WRITE`
- **Method is a long-running or streaming operation** : No.  
- **Filter for this method** : `
  protoPayload.methodName="cloud_cache.MemcacheAdminService.SetMemcacheItem"
  `