I want to log the requests that come to my Amazon CloudFront distributions.
Resolution
To turn on logging for CloudFront distributions, you can use CloudFront standard logs or CloudFront real-time logs.
Turn on CloudFront standard logs
Prerequisites:
To turn on standard logging for a CloudFront distribution, complete the following steps:
- Open the CloudFront console.
- Select the distribution that you want to update.
- In the General tab, under Settings, choose Edit.
- For Standard logging, select On.
- Choose the S3 bucket where you want CloudFront to deliver the log files. You can specify an optional prefix for the file names.
- (Optional) For Cookie logging, select On or Off. If turned on, then CloudFront logs the cookies in all requests regardless of which cookies you forward to the origin.
- Choose Save changes.
Turn on CloudFront real-time logs
Create and use a real-time log configurations