Interesting idea, but...
Interesting idea, but...
Posted Nov 20, 2011 19:59 UTC (Sun) by quotemstr (subscriber, #45331)In reply to: Interesting idea, but... by vrfy
Parent article: That newfangled Journal thing
Having a fluid format during development is acceptable. Shipping a critical component that writes with an unstable format is not.
> the journal files are just an indexed ring buffer that follow store/forward logic
Have you guys looked at ETW, the Windows event logging facility? The designers encountered and solved many of the issues that journal will run into. I still prefer plain-text logs to binary ring-buffer abominations, but if you're going to go down the latter route, you might as well learn from the past.
One convenient feature of ETW is a configurable and flexible approach to log management. ETW lets you decide on a per-log basis whether you want ring or serial logging, whether you want new log files to be created as old ones fill up, how often you want logs flushed to disk, and so on. ETW also has a "real-time consumer" option that basically pipes log messages to a process instead of writing them to disk, allowing programs to perform actions when certain system events happen. (You can even start a service when a certain log message appears.) The kernel also uses ETW to log its messages, allowing you to configure all the logging in one place.
Now, the details of ETW are disgusting: there are too many overlapping log options (you can do log rotation two different ways), too many log-message formats, too much metadata for each message (do we really need separate "keywords" and "categories" and such?), and too baroque an API. It's too damned hard to get simple plain-text output from the Windows event-logging system.
But beneath all the grime, there are some interesting ideas.
