[systemd-devel] journal use case -- advice requested

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri Feb 1 08:47:27 PST 2013

On Thu, Jan 31, 2013 at 10:51:07PM -0800, David Strauss wrote:
> We're using a wrapper for sd_journal_print() that adds a few extra
> items before the message: the thread ID and the build ID. This is okay
> for now, but I'd really like to get advice on how to inject those as
> proper fields without adding them manually to every logging call. I'd
> also like to maintain our global log-level support that quickly
> ignores any entries too verbose for the current configuration.
> I've tried a few approaches short of really arcane macros, but it
> looks like the right stuff just isn't exposed to users of the journal
> library. Rolling out own variadic logging function seems to require
> fill_iovec_sprintf(), but that's private.
> Any suggestions? Or should I explore patching the journal API to make
> it more modular?
I think so. Especially that TOOD says "journald: also get thread ID
from client, plus thread name".


More information about the systemd-devel mailing list