cloud-init.log inconsistent date format

Bug #1351960 reported by Darik Horn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Joshua Harlow

Bug Description

The first field of the /var/log/cloud-init.log file alternates between ISO and local date formats. In the attached example, the change happens at:

 2014-08-03 01:45:53,472 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
 2014-08-03 01:45:53,472 - util.py[DEBUG]: cloud-init mode 'init' took 12.704 seconds (12.71)
 Aug 3 01:45:56 test209 [CLOUDINIT] util.py[DEBUG]: Cloud-init v. 0.7.5 running 'modules:config' at Sun, 03 Aug 2014 01:45:56 +0000. Up 94.33 seconds.
 Aug 3 01:45:56 test209 [CLOUDINIT] importer.py[DEBUG]: Looking for modules ['cc_emit_upstart', 'cloudinit.config.cc_emit_upstart'] that have attributes ['handle']

Expected behavior is consistency in the date format.

Revision history for this message
Darik Horn (dajhorn) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

Well, i can give an explanation as to why this is the way it is, and how you could change it.
It is how it is because cloud-init first goes to /var/log/cloud-init.log "directly" as it runs before syslog is up.
Then, it transfers over to writing its logs to rsyslog, which in turn re-directs them there.

I agree that is annoying. maybe we could disable rsyslog logging by default (which might fix another isue).

Anyway, if you want consistentsy, you can set the format string in cloud.cfg.d/05_logging.cfg
or you could disable the attempt to use log_syslog.

To disable log_syslog, you could just do:

#cloud-config:
log_cfgs:
  - [ *log_base, *log_file ]

If you want to pass that in via user-data, you'd have to copy the content of those yaml references (see the file, you'll probably understand).

Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium
Joshua Harlow (harlowja)
Changed in cloud-init:
assignee: nobody → Joshua Harlow (harlowja)
milestone: none → 0.7.7
Scott Moser (smoser)
Changed in cloud-init:
milestone: 0.7.7 → 0.7.8
Scott Moser (smoser)
Changed in cloud-init:
milestone: 0.7.8 → 0.7.9
Scott Moser (smoser)
Changed in cloud-init:
milestone: 0.7.9 → none
status: Confirmed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.