[systemd-devel] in-kernel structured logging

Mantas Mikulėnas grawity at gmail.com
Thu Jul 30 12:41:07 PDT 2015


On Thu, Jul 30, 2015 at 9:47 PM, Anne Mulhern <amulhern at redhat.com> wrote:
>
> Where can the support for structured logging be found in the kernel?
> It seems tricky, given the kernel's constraints, to support arbitrary
> structured logging.
>

It was added to kernel/printk.c in v3.5 – printk_emit() accepts an array of
key=value metadata, and printk() is a thin wrapper around that.

At the same time /dev/kmsg was added, to export the attached data and fix
various other problems which /proc/kmsg had.

https://git.kernel.org/linus/7ff9554bb578
https://git.kernel.org/linus/e11fea92e13f
https://git.kernel.org/linus/c4e00daaa96d
https://git.kernel.org/linus/3b552b92817c

Rsyslog can import the structured data from /dev/kmsg:

http://www.rsyslog.com/doc/v8-stable/configuration/modules/imkmsg.html

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150730/d1e0a5fe/attachment.html>


More information about the systemd-devel mailing list