[systemd-devel] systemd-logger and external syslog daemon
Andrey Borzenkov
arvidjaar at mail.ru
Sat Mar 12 05:31:50 PST 2011
On Fri, Mar 11, 2011 at 8:35 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Fri, 11.03.11 19:41, Andrey Borzenkov (arvidjaar at mail.ru) wrote:
>
>> Well ... the problem really is that format is supposed to be single
>> printable character, which does not really support bit operations and
>> such. What about attached (completely untested) path - which adds <u>
>> marker to anything written into /dev/kmsg?
>
> Please don't do this. Let's not invent new interfaces here. Let's just
> stick to traditional syslog which is perfectly capable of handling this,
> because it allows for a full 8bit number between < and > which is 3 bits
> priority plus 5 bits facility.
>
> Then, let's fix the kernel side of kmsg to implicitly add in LOG_USER as
> facility for everything coming in from /dev/kmsg that has has facility=0
> set.
>
> Basically what Kay suggested.
>
> Facilities might not be the most powerful idea ever invented, but they
> are useful to distuingish kernel from userspace messages, as there is
> LOG_KERNEL for the former and all other facilities for the latter.
>
Attached patch preserves full syslog facility marker and simply emits
it back. So userspace is free to feed any facility it deems
appropriate, not only LOG_USER.
Compile tested only.
read_priority shamelessly borrowed from systemd :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: printk-syslog-facility.patch
Type: text/x-patch
Size: 4104 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20110312/1386ecd2/attachment.bin>
More information about the systemd-devel
mailing list