4 ms·
I'm planning to use it as logging solution. A cron command that needs to run every hour. It's whole execution will be recorded into a directory. Will be retaine
by wg0 3y ago
I'm planning to use it as logging solution. A cron command that needs to run every hour. It's whole execution will be recorded into a directory. Will be retained for a week worth of recording sessions.
These playbacks will allow to see how each invocation played out.
Unconventional, but going for it.
- janosdebugs 3y agoBe aware that the format is fairly inefficient, if your cron jobs write a lot, the files may become large. You may be better off investing into some good logging instead.
- deaddodo 3y agoI wouldn't say it's particularly inefficient...just taking a look at the format spec, if you were just taking straight output it would be a json blob with a header containing metadata and just a bunch of raw "o" events with line by line raw data. Certainly not as efficient as just outputting the STDOUT into a line-delimited format, but not inordinately larger.
- ku1ik 3y agoYou can also compress it with zstd or gzip. Those recordings compress like crazy, usually to about 15% of the input file size.
- wg0 3y agoTrue. logroate/fileroate kind of thing has to be in place with a cut off for 7 days or less. Logging would be too much (need some logging endpoint/log shipper etc) but the other upside is that I can see exactly how it plays out and when and what gets stuck. The actual console output of the command as it progresses. Think terraform.