Merge ~harlowja/cloud-init:just-file-logs into cloud-init:master
Proposed by
Joshua Harlow
Status: | Merged |
---|---|
Merged at revision: | 11b1aba4597379051e6b934e2b8f5a455e26ef14 |
Proposed branch: | ~harlowja/cloud-init:just-file-logs |
Merge into: | cloud-init:master |
Diff against target: |
38 lines (+12/-4) 1 file modified
config/cloud.cfg.d/05_logging.cfg (+12/-4) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
cloud-init Commiters | Pending | ||
Review via email:
|
To post a comment you must log in.
I'd like to see this merged.
Currently we see mixed timestamp formats in cloud-init.log:
2016-08-29 15:12:15,475 - __init__.py[DEBUG]: handling ssh with freq=None and args=[] cfg[INFO] : cloud-init-cfg ['all', 'config']
Aug 29 15:12:15 p1 [CLOUDINIT] cloud-init-
The point in which the logging format changes depending on whether (and when) the syslog service becomes available and cloud-init updates the logging configuration.
Besides the mixed format, the default rsyslog format (On Ubuntu at least) doesn't include a sub-second timestamp by default, where as the logging module default %(asctime) does at least provide millisecond resolution (note the ,475 in the %(asctime) and the lack of subsecond resolution in the second entry from above).
I'd also like to see a change to the default formatting string to include the same [CLOUDINIT] string, which is injected in the syslog based formatting.
Keeping these strings consistent makes parsing cloud-init.log more reliable.
Please consider adding this to your MP, or conversely, I can propose this separately after
this MP is merged.
root@x1: /etc/cloud/ cloud.cfg. d# diff -u 05_logging.cfg.dist 05_logging.cfg (sys.stderr, )
--- 05_logging.cfg.dist 2016-07-14 18:49:20.000000000 +0000
+++ 05_logging.cfg 2016-09-15 21:51:12.592673811 +0000
@@ -35,7 +35,7 @@
args=
[formatter_ arg0Formatter] s[%(levelname) s]: %(message)s s[%(levelname) s]: %(message)s
- format=%(asctime)s - %(filename)
+ format=%(asctime)s [CLOUDINIT] %(filename)