[systemd-devel] journald API documentation
Lennart Poettering
lennart at poettering.net
Mon Jul 9 07:54:47 PDT 2012
On Fri, 29.06.12 15:09, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> > It shouldn't be ignored, but journalctl currently just skips over it in
> > the normal output, since there is nothing to show. The data should
> > actually be stored on disk just fine, and the verbose mode of journalctl
> > should show it.
> Oh, that explains it. journalctl -o verbose and -o export indeed show that
> it is logged.
>
> Invalid messages like "=goo" error out. That's good.
>
> "MESSAGE=" is logged, and even displayed as an empty line with '-o
> short'. That might be good, I'm not sure.
>
> But "message=" is neither logged, nor causes an error. What's going on
> here?
Hmm, sounds like a bug. I have added an item to the todo list to fix this.
> > The fields are typeless and can carry anything you like. We suggest
> > people format things as ASCII strings wherever possible, UTF-8 where
> > necessary, and binary where nothing else makes sense. This is what we
> > call "primarily ASCII". But yeah the bit that UTF-8 is the second best
> > thing if pure ASCII is not applicable is currently not mentioned anyway
> > and deserves.
>
> OK, that's fine, as long as 'ASCII' here means a script subset of UTF-8.
> Then applications can just "show UTF-8".
I have changed the docs now in git to say UTF-8 everywhere.
> > The idea is that log viewers try to detect if something is valid UTF8
> > and show it as such if it is. If it isn't they should show something
> > like a hexdump or so instead. Currently journalctl isn't really doing
> > this yet, it just has a very simple logic that checks for a subset of
> > ASCII. This needs to be beefed up...
>
> Let's just hope that this doesn't deteriorate into web-style 90%-successful
> encoding-guessing-game.
Well, the three things we "support" are all supersets of each other:
UTF8 is a superset of ASCII and "binary" is a superset of UTF8, so the
guessing shouldn't be too hard to do, and not result in wrong guesses...
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list