From 08b50a6ea239f480493f202c563d788cabb92380 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 14 Jan 2014 13:18:14 -0500 Subject: provide default 'output' setting to log to /var/log/cloud-init-output.log This has been "best practice" for quite some time, and its a common request of "where is the output of my user-data programs". http://askubuntu.com/questions/345344/where-are-the-logs-for-my-user-data-script-cloud-init --- ChangeLog | 2 ++ config/cloud.cfg.d/05_logging.cfg | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8029f9af..1c240c68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ (LP: #1260072). - Azure: minor changes in logging output. ensure filenames are strings (not unicode). + - config/cloud.cfg.d/05_logging.cfg: provide a default 'output' setting, to + redirect cloud-init stderr and stdout /var/log/cloud-init-output.log. 0.7.4: - fix issue mounting 'ephemeral0' if ephemeral0 was an alias for a partitioned block device with target filesystem on ephemeral0.1. diff --git a/config/cloud.cfg.d/05_logging.cfg b/config/cloud.cfg.d/05_logging.cfg index 410a0650..2e180730 100644 --- a/config/cloud.cfg.d/05_logging.cfg +++ b/config/cloud.cfg.d/05_logging.cfg @@ -59,3 +59,8 @@ log_cfgs: - [ *log_base, *log_file ] # A file path can also be used # - /etc/log.conf + +# this tells cloud-init to redirect its stdout and stderr to +# 'tee -a /var/log/cloud-init-output.log' so the user can see output +# there without needing to look on the console. +output: {all: '| tee -a /var/log/cloud-init-output.log'} -- cgit v1.2.3