Introduction

When you use logging with Amazon S3, you can record actions taken by users, and services on your Amazon S3 resources. You can then use the log records for auditing and compliance purposes.

S3log

You can log Amazon S3 actions using server access logs or AWS CloudTrail logs.

Server access logging is a mechanism that provides detailed records for requests made to an S3 bucket.

Server access logging is disabled by default. Enable server access logging to start receiving logs. Log records are generally delivered within a few hours and it is rare to lose log records. There is no charge for enabling access logging, nor for PUT operations for log files. You are only charged for storage of the logs and for GET operations on the files. You can use object lifecycle management to minimize storage costs.

S3sal

AWS CloudTrail is a service that provides records of actions taken by a user, role, or service in your AWS Account. You can use CloudTrail to audit your account by logging and monitoring all activity. You can also use CloudTrail to detect unusual activity in your account.

Logging Amazon S3 actions with AWS CloudTrail helps keep your account secure by providing access auditing and analysis.

S3ct

Comparison

Log propertiesAWS CloudTrailAmazon S3 server logs
Can be forwarded to other systems (Amazon CloudWatch Logs, Amazon CloudWatch Events)YesNo
Deliver logs to more than one destination (for example, send the same logs to two different buckets)YesNo
Turn on logs for a subset of objects (prefix)YesNo
Cross-account log delivery (target and source bucket owned by different accounts)YesNo
Integrity validation of log file by using digital signature or hashingYesNo
Default or choice of encryption for log filesYesNo
Object operations (by using Amazon S3 APIs)YesYes
Bucket operations (by using Amazon S3 APIs)YesYes
Searchable UI for logsYesNo
Fields for Object Lock parameters, Amazon S3 Select properties for log recordsYesNo

Amazon Athena is an interactive query service that makes it easy for you to analyze data in Amazon S3 using standard SQL. You do not need to manage any infrastructure with Athena, and you pay only for the queries that you run.

Once you enable server access logs and store them in your target S3 bucket, you might want to analyze or search through them. Logs are not automatically analyzed by Amazon S3, and you might have a lot of data. To analyze all your Amazon S3 data, you can use Amazon Athena.

S3athena