I am trying to debug some complex cloud-config user data and am having trouble finding the location of the log entries of the specific commands that cloud-init is running for the user data.
As an example, I am starting an EC2 instance and providing some simple cloud-config user data of
## template: jinja
#cloud-config
runcmd:
- echo 'unique-1234'
- echo 'Hello Cloud' > /tmp/cloud.log
I can confirm that cloud-init is running my user data commands:
- the file
/tmp/cloud.log
exists and has the provided text - the
var/log/cloud-init-output.log
file contains the echoed “unique-1234”
However, what I want is some log information on what user data modules and commands were actually run.
That data should be in /var/log/cloud-init.log
, but I can’t find any evidence of it. There are lots of entries that look like:
Running command ['lsb_release', '--all'] with allowed return codes [0] (shell=False, capture=True)
But a nothing about the user data provided commands I want to run. grep 'echo' /var/log/cloud-init.log
has zero results.
After reading the logging documentation for cloud-init, I tried adding the following to my cloud-config yaml
reporting:
debug_log:
level: DEBUG
type: log
but the results were the same — no new entries to cloud-init.log
.