Logging

This document provides instructions to manage Logging using the CLI. Additionally, these tasks can also be performed using the web console and IONOS S3 Object Storage API.

Prerequisites:

Commands

Prerequisite: Grant permissions to the Log Delivery Group to the bucket where logs will be stored. We recommend using a separate bucket for logs, but it must be in the same S3 region. Log Delivery Group must be able to write objects and read ACL.

aws s3api put-bucket-acl \
    --bucket MY-BUCKET-FOR-LOGS \
    --grant-write URI=http://acs.amazonaws.com/groups/s3/LogDelivery \
    --grant-read-acp URI=http://acs.amazonaws.com/groups/s3/LogDelivery \
    --endpoint-url https://s3-eu-central-2.ionoscloud.com

After that, you can enable Logging for a bucket:

aws s3api put-bucket-logging \
    --bucket MY-BUCKET \
    --bucket-logging-status file://logs-acl.json \
    --endpoint-url https://s3-eu-central-2.ionoscloud.com

Contents of logs-acl.json:

Retrieve bucket logging settings:

aws s3api get-bucket-logging \
   --bucket MY-BUCKET \
   --endpoint-url https://s3-eu-central-2.ionoscloud.com

Disable logging for a bucket:
aws s3api put-bucket-logging \
   --bucket MY-BUCKET \
   --bucket-logging-status '{}' \
   --endpoint-url https://s3-eu-central-2.ionoscloud.com

Last updated