How do I turn on logging for my CloudFront distribution?

2 minute read
0

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:

  1. Open the CloudFront console.
  2. Select the distribution that you want to update.
  3. In the General tab, under Settings, choose Edit.
  4. For Standard logging, select On.
  5. Choose the S3 bucket where you want CloudFront to deliver the log files. You can specify an optional prefix for the file names.
  6. (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.
  7. Choose Save changes.

Turn on CloudFront real-time logs

Create and use a real-time log configurations

AWS OFFICIAL
AWS OFFICIALUpdated 7 months ago