> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Logs in Object Storage

Object Storage keeps logs of actions that are performed on buckets and objects. You can view and analyze these logs as events in the [Audit Logs](https://docs.nebius.com/audit-logs/index.md) service.

There are two types of logs in Object Storage:

* *Control plane logs* describe actions on buckets, such as creating and deleting buckets or getting and updating buckets' settings. Control plane logs are always available for all buckets.
* *Data plane logs* describe actions on objects, such as uploading, downloading, and deleting objects. By default, Object Storage does not keep data plane logs for your buckets. For each individual bucket, you can enable partial or full data plane logging. This can help you identify object usage patterns to optimize storage costs, improve performance of critical parts of your applications, and comply with regulations, such as the [Health Insurance Portability and Accountability Act](https://www.hhs.gov/hipaa/index.html) (HIPAA).

  > [!NOTE]
  >
  > Data plane logs are in [preview](https://docs.nebius.com/overview/services.md#preview). Before enabling them, [contact support](https://console.nebius.com/support/create-ticket).

  Audit Logs has a throughput quota for data plane logs. Logs beyond that quota are not recorded. You can monitor data plane events to avoid exceeding the quota. For more information, see [Quotas in Audit Logs](https://docs.nebius.com/audit-logs/resources/quotas-limits.md).

## Prerequisites

If you use the web console, you don't need to complete any prerequisites.

> [tab] CLI
>
> [Install and configure](https://docs.nebius.com/cli/install.md) the Nebius AI Cloud CLI.

> [tab] Terraform
>
> [Install and configure](https://docs.nebius.com/terraform-provider/install.md) the Nebius AI Cloud provider for Terraform.

> [tab] Go SDK
>
> [Install and initialize the Nebius SDK for Go](https://docs.nebius.com/sdk/go/install-auth.md).

> [tab] Python SDK
>
> [Install and initialize the Nebius SDK for Python](https://docs.nebius.com/sdk/python/install-auth.md).

> [tab] JavaScript SDK
>
> [Install and initialize the Nebius SDK for JavaScript](https://docs.nebius.com/sdk/javascript/install-auth.md).

## How to configure data plane logs

To configure data plane logs for a bucket, you need the `admin` [role](https://docs.nebius.com/iam/authorization/roles.md) for the bucket, its parent project, or tenant.

> [tab] Web console
>
> You can configure data plane logs when [creating a bucket](https://console.nebius.com/storage/create) or on the **Settings** page of an existing bucket:
>
> 1. Enable or disable the **Data plane Audit Logs** setting.
> 2. If the setting is on, choose whether to log all actions or only actions that change objects. See the [list of logged data plane actions](#logged-data-plane-actions).

> [tab] Nebius AI Cloud CLI
>
> To configure data plane logs when [creating](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-create-buckets-nebius-ai-cloud-cli) (`nebius storage bucket create`) or [modifying buckets](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-modify-buckets-nebius-ai-cloud-cli) (`nebius storage bucket update`), add the `--object-audit-logging` parameter to the command:
>
> * `--object-audit-logging all`: All data plane actions are logged.
> * `--object-audit-logging mutate_only`: Only data plane actions that change objects are logged.
> * `--object-audit-logging none` (default): Data plane actions are not logged.
>
> See the [list of logged data plane actions](#logged-data-plane-actions).
>
> For example, to enable full data plane logging in an existing bucket, run the following command:
>
> ```bash theme={null}
> nebius storage bucket update \
>   --id <bucket_ID> \
>   --object-audit-logging all
> ```

> [tab] Terraform
>
> To configure data plane logs when [creating](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-create-buckets) or [modifying buckets](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-modify-buckets), add the `object_audit_logging` parameter to the `nebius_storage_v1_bucket` resource:
>
> * `object_audit_logging = "all"`: All data plane actions are logged.
> * `object_audit_logging = "mutate_only"`: Only data plane actions that change objects are logged.
> * `object_audit_logging = "none"` (default): Data plane actions are not logged.
>
> See the [list of logged data plane actions](#logged-data-plane-actions).
>
> For example, to enable full data plane logging in a bucket, use the following configuration:
>
> ```hcl theme={null}
> resource "nebius_storage_v1_bucket" "my_bucket" {
>   name                 = "<bucket_name>"
>   parent_id            = "<project_ID>"
>   object_audit_logging = "all"
> }
> ```
>
> For more information about the `nebius_storage_v1_bucket` resource, see the [Terraform provider documentation](https://docs.nebius.com/terraform-provider/reference/resources/storage_v1_bucket.md).

> [tab] Go SDK
>
> To configure data plane logs when [creating](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-create-buckets-go-sdk) or [modifying buckets](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-modify-buckets-go-sdk), set `ObjectAuditLogging` on the bucket specification.
>
> The example below enables full data plane logging for an existing bucket:
>
> ```go theme={null}
> loggingService := sdk.Services().Storage().V1().Bucket()
> loggingBucket, err := loggingService.Get(
>     ctx,
>     &storage.GetBucketRequest{Id: "<bucket_ID>"},
> )
> if err != nil {
>     return err
> }
> loggingBucket.Spec.ObjectAuditLogging = storage.BucketSpec_ALL
> loggingOperation, err := loggingService.Update(
>     ctx,
>     &storage.UpdateBucketRequest{
>         Metadata: loggingBucket.Metadata,
>         Spec:     loggingBucket.Spec,
>     },
> )
> if err != nil {
>     return err
> }
> if _, err = loggingOperation.Wait(ctx); err != nil {
>     return err
> }
> ```
>
> In the code, set the following parameters:
>
> * `Id`: Bucket ID.
> * `ObjectAuditLogging`: Logging mode. The example sets `BucketSpec_ALL`, which logs all data plane actions.
>
> See the [list of logged data plane actions](#logged-data-plane-actions).

> [tab] Python SDK
>
> To configure data plane logs when [creating](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-create-buckets-python-sdk) or [modifying buckets](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-modify-buckets-python-sdk), set `object_audit_logging` on the bucket specification.
>
> The example below enables full data plane logging for an existing bucket:
>
> ```python theme={null}
> logging_service = BucketServiceClient(sdk)
> logging_bucket = await logging_service.get(
>     GetBucketRequest(id="<bucket_ID>"),
> )
> logging_bucket.spec.object_audit_logging = (
>     BucketSpec.ObjectAuditLogging.ALL
> )
> logging_operation = await logging_service.update(
>     UpdateBucketRequest(
>         metadata=logging_bucket.metadata,
>         spec=logging_bucket.spec,
>     ),
> )
> await logging_operation.wait()
> ```
>
> In the code, set the following parameters:
>
> * `id`: Bucket ID.
> * `object_audit_logging`: Logging mode. The example sets `BucketSpec.ObjectAuditLogging.ALL`, which logs all data plane actions.
>
> See the [list of logged data plane actions](#logged-data-plane-actions).

> [tab] JavaScript SDK
>
> To configure data plane logs when [creating](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-create-buckets-javascript-sdk) or [modifying buckets](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-modify-buckets-javascript-sdk), set `objectAuditLogging` on the bucket specification.
>
> The example below enables full data plane logging for an existing bucket:
>
> ```ts theme={null}
> const loggingService = new BucketService(sdk);
> const loggingBucket = await loggingService.get(
>   GetBucketRequest.create({ id: "<bucket_ID>" }),
> ).result;
> loggingBucket.spec.objectAuditLogging =
>   BucketSpec_ObjectAuditLogging.ALL;
> const loggingOperation = await loggingService.update(
>   UpdateBucketRequest.create({
>     metadata: loggingBucket.metadata,
>     spec: loggingBucket.spec,
>   }),
> ).result;
> await loggingOperation.wait();
> ```
>
> In the code, set the following parameters:
>
> * `id`: Bucket ID.
> * `objectAuditLogging`: Logging mode. The example sets `BucketSpec_ObjectAuditLogging.ALL`, which logs all data plane actions.
>
> See the [list of logged data plane actions](#logged-data-plane-actions).

Changes to existing buckets may take some time to apply. For example, if you enable data plane logs in an existing bucket, there may be a delay before logging begins.

### Logged data plane actions

Depending on whether you enabled all data plane logs (`all`) or only logs for actions that change objects (`mutate_only`), Object Storage logs actions that are performed by using the following [S3 API methods](https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_Simple_Storage_Service.html):

| Method | `all` | `mutate_only` |
| - | - | - |
| `PutObject` | ✓ | ✓ |
| `CopyObject` | ✓ | ✓ |
| `CreateMultipartUpload` | ✓ | ✓ |
| `UploadPart` | ✓ | ✓ |
| `UploadPartCopy` | ✓ | ✓ |
| `AbortMultipartUpload` | ✓ | ✓ |
| `CompleteMultipartUpload` | ✓ | ✓ |
| `DeleteObject` | ✓ | ✓ |
| `DeleteObjects` | ✓ | ✓ |
| `DeleteObjectVersion` | ✓ | ✓ |
| `GetObject` | ✓ | — |
| `HeadObject` | ✓ | — |
| `ListParts` | ✓ | — |
| `ListObjectVersions` | ✓ | — |
| `ListObjects` | ✓ | — |
| `ListMultipartUploads` | ✓ | — |

Actions that do not create, read, update or delete objects themselves, such as `GetObjectAcl` or `PutObjectTagging`, are not logged, even if Object Storage supports them. Requests that result in HTTP client errors `400 Bad Request` and `429 Too Many Requests` are also not logged.

## How to view logs

You can view control plane logs and data plane logs from buckets that have them enabled in Audit Logs:

> [tab] Web console
>
> 1. In the sidebar, go to  **Administration** → **Audit Logs**.
> 2. Select the region to search for Object Storage audit events.
> 3. Select **Control plane** or **Data plane**.
> 4. Filter events by the `STORAGE` service. If this filter is not displayed, click **Filters** and then select **Service**.

> [tab] Nebius AI Cloud CLI
>
> Run [nebius audit v2 audit-event list](https://docs.nebius.com/cli/reference/audit/v2/audit-event/list.md) to get control plane logs:
>
> ```bash theme={null}
> nebius audit v2 audit-event list \
>   --parent-id <tenant_ID> \
>   --start <time_in_ISO_8601> \
>   --end <time_in_ISO_8601> \
>   --filter "service.name='STORAGE'" \
>   --event-type control_plane \
>   --region <region_ID>
> ```
>
> In the command above, specify:
>
> * `--parent-id`: [Tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-cli).
> * `--start`: Start time for the search, in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
> * `--end`: End time for the search, in the ISO 8601 format.
> * `--region`: [Region](https://docs.nebius.com/overview/regions.md) to search for Object Storage audit events.
> * `--filter`: Filter expression. Set it to `service.name='STORAGE'` to return only Object Storage events. For more information, see [How to filter audit events](https://docs.nebius.com/audit-logs/events/filter.md).
> * `--event-type`: Type of audit event. Set it to `control_plane` to return control plane logs.
>
> To get data plane logs, replace `--event-type control_plane` with `--event-type data_plane`:
>
> ```bash theme={null}
> nebius audit v2 audit-event list \
>   --parent-id <tenant_ID> \
>   --start <time_in_ISO_8601> \
>   --end <time_in_ISO_8601> \
>   --filter "service.name='STORAGE'" \
>   --event-type data_plane \
>   --region <region_ID>
> ```

> [tab] Go SDK
>
> List control plane events:
>
> ```go theme={null}
> controlStartText := "<time_in_ISO_8601>"
> controlStart, err := time.Parse(time.RFC3339, controlStartText)
> if err != nil {
>     return err
> }
> controlEnd, err := time.Parse(time.RFC3339, "<time_in_ISO_8601>")
> if err != nil {
>     return err
> }
> controlService := sdk.Services().Audit().V2().AuditEvent()
> controlEvents, err := controlService.List(
>     ctx,
>     &audit.ListAuditEventRequest{
>         ParentId:  "<tenant_ID>",
>         Start:     timestamppb.New(controlStart),
>         End:       timestamppb.New(controlEnd),
>         Filter:    "service.name='STORAGE'",
>         EventType: audit.EventType_CONTROL_PLANE,
>         Region:    "<region_ID>",
>     },
> )
> if err != nil {
>     return err
> }
> fmt.Println(controlEvents)
> ```
>
> In the code, set the following parameters:
>
> * `ParentId`: [Tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-go-sdk).
> * `Start`: Start time for the search, in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. The code parses this value as RFC 3339.
> * `End`: End time for the search, in the ISO 8601 format. The code parses this value as RFC 3339.
> * `Filter`: Filter expression. The example uses `service.name='STORAGE'` to return only Object Storage events. For more information, see [How to filter audit events](https://docs.nebius.com/audit-logs/events/filter.md#how-to-filter-events-by-using-the-cli-or-an-sdk-go-sdk).
> * `EventType`: Type of audit event. The example sets `EventType_CONTROL_PLANE` to return control plane logs.
> * `Region`: [Region](https://docs.nebius.com/overview/regions.md) to search for Object Storage audit events.
>
> To get data plane logs, set `EventType` to `EventType_DATA_PLANE`:
>
> ```go theme={null}
> dataStart, err := time.Parse(time.RFC3339, "<time_in_ISO_8601>")
> if err != nil {
>     return err
> }
> dataEnd, err := time.Parse(time.RFC3339, "<time_in_ISO_8601>")
> if err != nil {
>     return err
> }
> dataService := sdk.Services().Audit().V2().AuditEvent()
> dataEvents, err := dataService.List(
>     ctx,
>     &audit.ListAuditEventRequest{
>         ParentId:  "<tenant_ID>",
>         Start:     timestamppb.New(dataStart),
>         End:       timestamppb.New(dataEnd),
>         Filter:    "service.name='STORAGE'",
>         EventType: audit.EventType_DATA_PLANE,
>         Region:    "<region_ID>",
>     },
> )
> if err != nil {
>     return err
> }
> fmt.Println(dataEvents)
> ```

> [tab] Python SDK
>
> List control plane events:
>
> ```python theme={null}
> control_service = AuditEventServiceClient(sdk)
> control_events = await control_service.list(
>     ListAuditEventRequest(
>         parent_id="<tenant_ID>",
>         start=datetime.fromisoformat("<time_in_ISO_8601>"),
>         end=datetime.fromisoformat("<time_in_ISO_8601>"),
>         filter="service.name='STORAGE'",
>         event_type=EventType.CONTROL_PLANE,
>         region="<region_ID>",
>     ),
> )
> print(control_events)
> ```
>
> In the code, set the following parameters:
>
> * `parent_id`: [Tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-python-sdk).
> * `start`: Start time for the search, in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
> * `end`: End time for the search, in the ISO 8601 format.
> * `filter`: Filter expression. The example uses `service.name='STORAGE'` to return only Object Storage events. For more information, see [How to filter audit events](https://docs.nebius.com/audit-logs/events/filter.md#how-to-filter-events-by-using-the-cli-or-an-sdk-python-sdk).
> * `event_type`: Type of audit event. The example sets `EventType.CONTROL_PLANE` to return control plane logs.
> * `region`: [Region](https://docs.nebius.com/overview/regions.md) to search for Object Storage audit events.
>
> To get data plane logs, set `event_type` to `EventType.DATA_PLANE`:
>
> ```python theme={null}
> data_service = AuditEventServiceClient(sdk)
> data_events = await data_service.list(
>     ListAuditEventRequest(
>         parent_id="<tenant_ID>",
>         start=datetime.fromisoformat("<time_in_ISO_8601>"),
>         end=datetime.fromisoformat("<time_in_ISO_8601>"),
>         filter="service.name='STORAGE'",
>         event_type=EventType.DATA_PLANE,
>         region="<region_ID>",
>     ),
> )
> print(data_events)
> ```

> [tab] JavaScript SDK
>
> List control plane events:
>
> ```ts theme={null}
> const controlService = new AuditEventService(sdk);
> const controlEvents = await controlService.list(
>   ListAuditEventRequest.create({
>     parentId: "<tenant_ID>",
>     start: new Date("<time_in_ISO_8601>"),
>     end: new Date("<time_in_ISO_8601>"),
>     filter: "service.name='STORAGE'",
>     eventType: EventType.CONTROL_PLANE,
>     region: "<region_ID>",
>   }),
> ).result;
> console.log(controlEvents);
> ```
>
> In the code, set the following parameters:
>
> * `parentId`: [Tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-javascript-sdk).
> * `start`: Start time for the search, in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
> * `end`: End time for the search, in the ISO 8601 format.
> * `filter`: Filter expression. The example uses `service.name='STORAGE'` to return only Object Storage events. For more information, see [How to filter audit events](https://docs.nebius.com/audit-logs/events/filter.md#how-to-filter-events-by-using-the-cli-or-an-sdk-javascript-sdk).
> * `eventType`: Type of audit event. The example sets `EventType.CONTROL_PLANE` to return control plane logs.
> * `region`: [Region](https://docs.nebius.com/overview/regions.md) to search for Object Storage audit events.
>
> To get data plane logs, set `eventType` to `EventType.DATA_PLANE`:
>
> ```ts theme={null}
> const dataService = new AuditEventService(sdk);
> const dataEvents = await dataService.list(
>   ListAuditEventRequest.create({
>     parentId: "<tenant_ID>",
>     start: new Date("<time_in_ISO_8601>"),
>     end: new Date("<time_in_ISO_8601>"),
>     filter: "service.name='STORAGE'",
>     eventType: EventType.DATA_PLANE,
>     region: "<region_ID>",
>   }),
> ).result;
> console.log(dataEvents);
> ```

For more details, see [Viewing events in Audit Logs](https://docs.nebius.com/audit-logs/events/view.md).

Parameters of an action, such as the bucket name and the object key, are returned in the `.request.parameters` field of the Audit Logs event. For example:

```json theme={null}
{
  "request": {
    "parameters": {
      "bucket_name": "bucket-test",
      "object_key": "data/config.yaml",
      "version": "0[isNull=true,isLatest=false]"
    }
  }
}
```

For more details, see [Structure and fields of events in Audit Logs](https://docs.nebius.com/audit-logs/events/reference.md).
