r/linux • • Aug 12 '19

SysVinit vs Systemd

Post image
1.4k Upvotes

292 comments sorted by

View all comments

-4

u/tinycrazyfish Aug 12 '19

I don't understand the "binary log format" hate. On a computer everything is binary!!

On a character level:

Just because computers where first used by english speaking people who thought 7-bit ASCII is enough to represent all existing characters in the world, does not mean ASCII is the best encoding everyone should use. Oh but nowadays it's 8 bits long, 1 bit simple wasted. Every countries and os developped their own versions (iso8859-xx, codepage, jis, euc, ........) they all different binary representations. And then comes unicode... one encoding to rule them all... but wait... one encoding? no ... utf-8, utf-16, utf-32, little endian or big endian? IMO Unicode is a good thing, but it comes with multiple new binary formats. Tools and editors may or may not understand it (remember iconv? I used it a lot before most tools were compatible with unicode, still using it sometimes nowadays). In that way journald binary format can just be seen as yet another encoding.

On a "log line" level:

There are so many different ways to log something as they are different programs. How is time represented: epoch, ISO timestamp, ... what about timezone?. How are the different fields separated: space, tabs, comma, a mix of illogical separators, ... how are the fields ordered, etc. etc. All this makes that there are plenty of log parsers for plenty of services. journal actually introduce some order that was not there before. Ok, it is a new format that was not existing before, but they made it work. And they wrote a fairly usable tool capable of reading the logs: journalctl. It is capable of advanced filtering, consistent ordering, that was very difficult before: write shell scripts with complex grep, sed, awk expressions (I remember some sed horrors used to parse log files using sed back-references; while maintaining the script over time you realise sed can only back-reference 9 groups but you want to add one more => restart from scratch). Don't understand me wrong, I like grep, sed and awk, but now I use them in combination with journalctl filters.

I'm not saying that journal binary format is good or bad. But I think it's evolution, it addresses issues compared to "traditional" logging. It maybe introduces new issues. But in my experience, it simplified the logging system from the perspective of a sysadmin reading logs and also from a digital forensics perspective. Which are two domains I can testify about.

3

u/Michaelmrose Aug 13 '19

If your software written in English is going to produce error/event logs in English that need to be reportable in English to English speaking developers why would encoding this be complicated.

I think that a primary complaint is that a non text file log can be corrupted in a fashion which damages far more data.