Skip to content

Commit 4b2448c

Browse files
authored
Merge pull request #1486 from chrischdi/pr-cloud-init-stream-to-stdout
cloud-init: improve logging to stream logs to the cloud-init-output.log file instead of dumping at the end
2 parents 2d4e497 + 0a029cf commit 4b2448c

File tree

1 file changed

+1
-1
lines changed
  • images/capi/ansible/roles/providers/files/etc/cloud/cloud.cfg.d

1 file changed

+1
-1
lines changed

images/capi/ansible/roles/providers/files/etc/cloud/cloud.cfg.d/05_logging.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ log_cfgs:
6464
# this tells cloud-init to redirect its stdout and stderr to
6565
# 'tee -a /var/log/cloud-init-output.log' so the user can see output
6666
# there without needing to look on the console.
67-
output: {all: '| python3 -c ''import sys,time;sys.stdout.write("".join(( " ".join((time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime()), line)) for line in sys.stdin )))'' | tee -a /var/log/cloud-init-output.log'}
67+
output: {all: '| python3 -c ''exec("import sys,time\nfor line in sys.stdin:\n sys.stdout.write(\" \".join((time.strftime(\"[%Y-%m-%d %H:%M:%S]\", time.localtime()), line)))")'' | tee -a /var/log/cloud-init-output.log'}

0 commit comments

Comments
 (0)