Where to find logs for a cloud-init user-data script?
You could create a cloud-config file (with "#cloud-config" at the top) for your userdata, use runcmd to call the script, and then enable output logging like this:
output: {all: '| tee -a /var/log/cloud-init-output.log'}
The default location for cloud init user data is already /var/log/cloud-init-output.log
, in AWS, DigitalOcean and most other cloud providers. You don't need to set up any additional logging to see the output.