Amazon CloudFront Functions now supports logging to CloudFront access logs

CloudFront Functions Custom Log Data
You can now write custom data directly into CloudFront access logs using a new helper method available from within CloudFront Functions. This allows you to log values such as A/B test variant assignments, authentication outcomes, or routing decisions directly into the CloudFront access log record for that request.
What to do
- Use
cf.logCustomData()from viewer request or viewer response functions. - Analyze function behavior and request outcomes in a single query.
- Combine with existing
console.log()functionality.
Source: AWS release notes
If you need further guidance on AWS, our experts are available at AWS@westloop.io. You may also reach us by submitting the Contact Us form.



