I strace with that of:
logger "[FOO] bar"
And found that logger writes 16 bytes before the message, an example with
apostrophe added to show trailing white space:
'Dec 19 13:18:44 '
If I modify the above test case to as:
format=0123456789012345[CLOUDINIT] %(filename)s[%(levelname)s]: %(message)s
Then I get my message correctly filtered to /var/log/cloud-init.log.
Ie, running:
$ ./python-logging-syslog.py "hello world"
displays:
0123456789012345[CLOUDINIT] python-logging-syslog.py[DEBUG]: hello world
produces in /var/log/cloud-init.log:
Dec 19 18:25:45 server-3418 [CLOUDINIT] python-logging-syslog.py[DEBUG]:
hello world
, and a new line there like:
Dec 19 18:22:06 server-3418 [CLOUDINIT] mytest.py[DEBUG]: foo
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/905419
Title:
cloud-init messages going to syslog, not cloud-init.log
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/905419/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs