S3 Log Archiving is currently in limited beta release and is only available on the Enterprise plan. Please note that this feature is subject to limited availability while in the beta release stage.
Setup
Prerequisites
To begin sending log archives to an S3 bucket, you must have your own AWS account and an S3 bucket configured for this purpose. This must be the sole purpose of your S3 bucket (that is, do not add other content to this bucket), your S3 bucket must have versioning enabled, and your S3 bucket must be in the same region as your Stack. To enable S3 bucket versioning via the AWS Console, visit the Properties tab of your S3 bucket, click Edit under Bucket Versioning, choose Enable, and then Save Changes.Process
Once you have created a bucket and enabled versioning, apply the following policy to the bucket in order to allow Aptible to replicate objects to it. You need to replace
YOUR_BUCKET_NAME
in both “Resource” sections with the name of your bucket. - Your AWS Account ID.
- The name of your S3 bucket to use for archiving.
Delivery
To ensure you only need to read or process each file once, we do not upload any files which are actively being written to. This means we will only upload a log archive file when either of two conditions is met:- After the container has exited, the log file will be eligible for upload.
- If the container log exceeds 500 MB, we will rotate the log, and the rotated file will be eligible for upload.
Retrieval
You should not need access the log files from your S3 bucket directly, as Aptible has provided a command in our CLI that provides you the ability to search, download and decrypt your container logs:aptible logs_from_archive
.
This utility has no reliance on Aptible’s services, and since the S3 bucket is under your ownership, you may use it to access your Log Archive even if you are no longer a customer of Aptible.