Hacker News new | ask | show | jobs
by dijit 2347 days ago
How do you feel about things like systemd’s journal binary logging system?

Is this an acceptable case of non-text format? And if it is, what makes it different?

5 comments

Does anyone need to keep system logs for fifty years?

Practically speaking, I'm fine with a constraint where the systemd database format + tools need to be roughly kept in sync. I can't think of a realistic example where this wouldn't be the case. Most of the logs in this database are supposed to be ephemeral.

If you're in banking or medicine or something and are required to keep certain logs for a decade+, you should figure out what you actually want to keep and put it in a format that would be reasonable to access on that kind of timeline.

> Practically speaking, I'm fine with a constraint where the systemd database format + tools need to be roughly kept in sync. I can't think of a realistic example where this wouldn't be the case.

That can only happen in practice if you take the logger and tools from the same group of developers. Yet another case of forced lock-in from Systemd.

We keep logs for either 3 or 7 years, depending. journald is a waste of electrons for us, and that's one (of several) reasons why.
Btw there is Journal Export Format[1], which one can use to archive or process selected journal data in a simple plain text form.

[1] https://www.freedesktop.org/wiki/Software/systemd/export

IMHO binary logging is case of premature optimization.

The premise is that somehow binary logs buys you something. Either more precise data or faster access or something else.

Truth is, it could all have been done in ascii and it would have been more portable, accessible and resilient to failure.

No idea what systemd's implementation is meant to accomplish, but, in general, on a memory-constrained system, a binary log can theoretically speed up system performance by taking up less memory, which leads to more available pages for other purposes.
But would you even run a systemd-based Linux distribution on a memory-constrained system?
Does anyone actually look at the systemd log? I ignore it. Rsyslogd handles all of our logging needs in a sensible textual format that does not require special commands to view or useless make-work to pipe into a database.

To answer your question, I thought and still think it was a bad choice. The only time I would ever be interested in the contents are during early-boot failures, exactly the time when the toolset is limited and most folks aren't familiar with what's available - exactly when simple text is easiest to work with without finding another machine to stare at the `journalctl` man page.

The rationalization about detecting record corruption makes very little sense to me. (Now, there is a valid concern about potential log forgery, enabled by poorly written apps that directly log user input without sanitation. But that's better mitigated in the buggy app, which almost certainly is doing other unsafe things with user input. And if that were actually the concern, they had other choices that would have been far less annoying.)

One could better ask how people feel about all of the binary databases that exist in Unix, from the Berkeley DB databases used for the likes of termcap and the system account database on the BSDs, to the binary login database that has been around since the 1970s.

* http://jdebp.uk./FGA/unix-login-database.html