[Bug 905419] Re: cloud-init messages going to syslog, not cloud-init.log

Scott Moser smoser at ubuntu.com
Mon Dec 19 18:26:56 UTC 2011


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
Foundations Bugs, which is subscribed to rsyslog in Ubuntu.
https://bugs.launchpad.net/bugs/905419

Title:
  cloud-init messages going to syslog, not cloud-init.log

Status in “rsyslog” package in Ubuntu:
  Confirmed

Bug description:
  on boot of a precise image, I did not see messages in /var/log/cloud-
  init.log as expected.

  I noticed that some of them are in /var/log/syslog:
  Dec 16 16:41:30 server-3393 d-init-cfg[INFO]: cloud-init-cfg ['all', 'config']
  Dec 16 16:41:30 server-3393 it__.py[DEBUG]: handling mounts with freq=None and args=[]
  Dec 16 16:41:30 server-3393 SourceEc2.py[DEBUG]: unable to convert swap to a device
  Dec 16 16:41:30 server-3393 kernel: [   83.058563] kjournald starting.  Commit interval 5 seconds
  Dec 16 16:41:30 server-3393 it__.py[DEBUG]: handling ssh-import-id with freq=None and args=[]
  Dec 16 16:41:30 server-3393 sh_import_id.py[DEBUG]: importing ssh ids. cmd = ['sudo', '-Hu', 'ubuntu', 'ssh-import-id', 'smoser']

  I'm not sure where the beginning of those log statements are going.

  cloud-init uses python logging, and places the following content in /etc/rsyslog.d/21-cloudinit.conf:
  # Log cloudinit generated log messages to file
  :syslogtag, isequal, "[CLOUDINIT]" /var/log/cloud-init.log

  # comment out the following line to allow CLOUDINIT messages through.
  # Doing so means you'll also get CLOUDINIT messages in /var/log/syslog
  & ~

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: cloud-init 0.6.2-0ubuntu1
  ProcVersionSignature: User Name 3.2.0-4.10-virtual 3.2.0-rc5
  Uname: Linux 3.2.0-4-virtual x86_64
  ApportVersion: 1.90-0ubuntu1
  Architecture: amd64
  Date: Fri Dec 16 17:29:28 2011
  Ec2AMI: ami-00000102
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.small
  Ec2Kernel: unavailable
  Ec2Ramdisk: unavailable
  PackageArchitecture: all
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: cloud-init
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/905419/+subscriptions




More information about the foundations-bugs mailing list