Feature changed by: Kay Sievers (kay_sievers) Feature #312466, revision 8 Title: Separate user and kernel log messages openSUSE Distribution: New Priority Requester: Important Requested by: Andreas Jaeger (a_jaeger) Product Manager: (Novell) Technical Contact: (Novell) Technical Contact: (Novell) Technical Contact: (Novell) Partner organization: openSUSE.org Description: SUSE used blogd to separate kernel and user log messages during boot. With systemd now everything is written to the kernel ring buffer. We should separate those again. Relations: - syslog (novell/bugzilla/id: 696963) https://bugzilla.novell.com/show_bug.cgi?id=696963 Discussion: #1: Kay Sievers (kay_sievers) (2011-05-31 15:13:14) They are separated by the facility value in the syslog prefix. The kernel was changed to handle this separation just fine. This is actually feature not something to work around. Proper syslog implementations can separate the messages just fine. Early boot tools should use the same log target as the kernel. Today, there is no reason to distinguish kernel- from userspace during early boot. As soon as the real syslog is running, the kernel buffer is not used anymore. #2: Dr. Werner Fink (wernerfink) (2011-05-31 16:18:11) (reply to #1) # echo Test printk > /dev/kmsg ; sleep 1; tail /var/log/messages | grep printk May 31 16:06:16 shannon kernel: [1743439.436249] Test printk ... linux/drivers/char/mem.c ... kmsg_write() ... linux/kernel/printk.c ... DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */ ... linux/include/linux/kernel.h ... KERN_WARNING #3: Andreas Jaeger (a_jaeger) (2011-05-31 16:40:01) (reply to #2) Kay, how does this separation work? With 2.6.39 and the echo that Werner used, I do not see it at all... #4: Kay Sievers (kay_sievers) (2011-05-31 16:51:44) (reply to #3) The echo needs the proper syslog prefix. The kernel uses the defaults if its missing. # echo '<30> LOG_INFO+LOG_DAEMON' > /dev/kmsg # dmesg -r | grep LOG_DAEMON <30>[172420.523276] LOG_INFO+LOG_DAEMON + #5: Kay Sievers (kay_sievers) (2011-05-31 18:03:29) (reply to #4) + Maybe this is easier to read: # logger test; dmesg -r | grep test [ + 41.342824] root[418]: test <13>[ 41.342824] root[418]: test The 13 is + LOG_USER LOG_NOTICE, which is 'logger' default. The kernel extracs the + LOG_NOTICE level for its own log-level processing. The kernel will use + LOG_KERNEL==0 for its messages, systemd used LOG_DAEMON==6 for the + messages. So all userspace messages sent by syslog() will be LOG_DAEMON + unless otherwise specified. Mixing them during early boot is actually a + wanted feature, it makes things easier to follow if things go wrong. + There is no information lost, syslog can sort or separate the messages + in any way it wants. -- openSUSE Feature: https://features.opensuse.org/312466