messages to rsyslog without timestamp lose 16 chars
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Rsyslog |
Fix Released
|
High
|
|||
rsyslog (Ubuntu) |
Fix Released
|
Medium
|
Scott Moser |
Bug Description
on boot of a precise image, I did not see messages in /var/log/
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.
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_
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.
# Log cloudinit generated log messages to file
:syslogtag, isequal, "[CLOUDINIT]" /var/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
ProcVersionSign
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
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitec
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Clint Byrum (community): Approve
-
Diff: 88 lines (+50/-2)5 files modified.pc/applied-patches (+1/-0)
debian/changelog (+8/-0)
debian/patches/100-imuxsock-allow-missing-date.patch (+34/-0)
debian/patches/series (+2/-0)
plugins/imuxsock/imuxsock.c (+5/-2)
summary: |
- cloud-init messages going to syslog, not cloud-init.log + messages to rsyslog without timestamp lose 16 chars |
Changed in rsyslog: | |
importance: | Unknown → High |
status: | Unknown → Confirmed |
Changed in rsyslog: | |
status: | Confirmed → Fix Released |
Changed in rsyslog (Ubuntu): | |
assignee: | nobody → Scott Moser (smoser) |
Rsyslog seems to be stripping log messages for python logging[1]
I've tested this in rsyslog 5.8.6. It was working fine in 5.8.5
Example:
in my python log file ini:
[formatter_ detailed] s(%(lineno) d): %(message)s
format=appname [%(process)d]: %(name)s %(module)
which gives:
Dec 6 09:22:06 hostname name module(230): message
If I add some spacing to my formatting:
[formatter_ detailed] xxxxxxxxxxxxxxx appname[ %(process) d]: %(name)s %(module) s(%(lineno) d): %(message)s
format=
I get what I'd expect to see (and what was working previously)
Dec 6 09:24:02 hostname appname[14019]: name module(230): message
Ubuntu Lucid;
rsyslogd 5.8.6, compiled with:
FEATURE_REGEXP: Yes
FEATURE_LARGEFILE: No
GSSAPI Kerberos 5 support: Yes
FEATURE_DEBUG (debug build, slow code): No
32bit Atomic operations supported: Yes
64bit Atomic operations supported: Yes
Runtime Instrumentation (slow code): No
[1] docs.python. org/library/ logging. html#logrecord- attributes
http://