3 ms·
Yeah, no. Maybe that worked in the 80s, back when hardware was weak, and an admin could keep an eye on everything by hand. I dealt with parsing log files more r
by dale_glass 5y ago
Yeah, no. Maybe that worked in the 80s, back when hardware was weak, and an admin could keep an eye on everything by hand. I dealt with parsing log files more recently than that, and it's a never-ending list of annoying bullshit to deal with:
* Some stuff logs with syslog and some doesn't.
* Formats vary, oh the fun of implementing the different variations.
* You have to parse text dates into unix, when whatever wrote the file converted unix to text. It probably lacks milliseconds, which is all kinds of fun in a modern setting where there can easily be a hundred things happening during any second.
* Various edge cases. Where exactly does every field in the log file end? Can there be a newline? (yes, guaranteed). Can there be random binary junk (yup, sometimes).
* How do you keep track of where you stopped parsing? How do you deal with that the old log might have been removed and a new one with the same name now appeared?
* Dealing with compression, log rotation, race conditions.
It's simple on the surface. Actually writing a program that deals with all that stuff is bloody annoying, because none of it actually gets what you want done. You typically want to detect important events happening, or graphing something. Instead, 95% of the time goes on mind-numbing minutia dealing with parsing because the system was built for an admin using `tail` and `grep` in the 80s. It wasn't planned for a modern admin maintaining a few dozen computers each of which log multiple megabytes of stuff every hour.
Never understood people who complain about journald, because this stuff was a pain in my butt a good decade before journald existed. I certainly don't have any fond memories from dealing with it.
- touisteur 5y agoI'm guessing i would have preferred to standardise something in syslog-ng and rsyslog, like a database-backed log-file format (sqlite?) instead of yet another piece of the yuge systemd hydra...
- dale_glass 5y agosqlite doesn't sound like a very good choice to me. journald's log format is nearly \0 separated fields, while sqlite is a good deal more complex than that. Also journald allows for append-only logs, which I don't think sqlite supports. And personally I see the "hydra" as a benefit -- everything integrates well with everything else, because it's all designed to go well together.
- touisteur 5y agoSorry, a bit late to reply but I'm mostly referring to the 'get the logs once your system is in a bad state) I've had better experience with file logs and database files than f'd-up journald logs... I think I saw somewhere a way to set a table as append-only and to put triggers to remove old entries in sqlite. If not pg is also your friend, what with partitioning and write-only tuning. I'm just not sure about the 'designed' part. Rsyslog is a great logger, hugely tuneable, with decades of advanced features, and I don't get why it could not be massaged to 'integrate' well in systemd, with all the money poured in it. The only explanation that I feel is convincing enough is control and made-in-redhat. I feel the same about ntp, and firewalld... But maybe I'm just old.