← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~harlowja/cloud-init:just-file-logs into cloud-init:master

 

Cloud-init's logging basically employed a "try syslog and fallback to direct log to file".
The proposed "just log to a file" is definitely dramatically simpler and advantageous in some cases.

The way the "try syslog and fallback" works (or worked) on Ubuntu up until systemd was:

a.) cloud-init init --local
    1. read logging config, 
    2. attempt to log to syslog ([ *log_base, *log_syslog ])
    3. that fail, so it log to file directly

b.) cloud-init init
   1.) rsyslog would have /dev/log up functional at this point
   2.) cloud-init logging config read and ends up logging to syslog

Systemd changed some things in teh way /dev/log was handled, and the above no longer worked well.

Additionally, cloud-init installs a file /etc/rsyslog.d/21-cloudinit.conf which tells rsyslog to redirect messages generated by cloud-init to /var/log/cloud-init.log

The value of doing this in this way was that we use syslog, so if the user had configured the system to log remotely, cloud-init's logs would go to that remote system as they desired.

If we directly log to a file, then cloud-init's log messages will not without further configuration go to syslog.

One other thing to be aware of is that cloud-init can itself configure rsyslog through cloudinit/config/cc_rsyslog.py .  So, the user could provide in user-data some rsyslog configuration, and then the system's syslog (including cloud-init messages) would start goign to that remote server as soon as they realistically could.
    
-- 
https://code.launchpad.net/~harlowja/cloud-init/+git/cloud-init/+merge/301729
Your team cloud init development team is requested to review the proposed merge of ~harlowja/cloud-init:just-file-logs into cloud-init:master.


Follow ups

References