- do you need tail?
- could you provide a link to a typical log file (with sensitive info removed of course)?
- do you need tail?
- could you provide a link to a typical log file (with sensitive info removed of course)?
For example the simplest JSON message would be:
{"timestamp":"2018-06- 29T17:25:47.857Z",
"module":"main",
"msg":"[\"trying to reconnect\"]",
"level":5}
while the human-readable representation for the same message is: global 17:06:067 trying to reconnect
So I'll have one main log file that gets everything in JSON, but that's only useful for post-hoc analysis. I can control what makes it to stdout at runtime but that's just a single view. So right now I've hard-coded the logging to spit out human-readable messages to different files based on the module and level properties. I open the files in auto-revert-tail-mode (emacs).Not sure what you mean do I need tail? If you mean the tail program then yea that's what I effectively do at the moment. If you mean always seeing the latest logs as they come in - yes.
So the ideal software would just read that one file (or db) that has everything in JSON (or machine readable format) and let you have different "views" over the same data. Packaged in a nice (web?) GUI.
It shouldn't be too hard to implement but I'm hoping there's something out there already.
https://softwarerecs.stackexchange.com/questions/37881/log-v...
https://github.com/gistia/json-log-viewer
https://github.com/brocode/fblog
I am currently writing a log viewer / terminal combo for internal use. Handling milti-line json with tailing is a bit of a challenge though.
tail -F my.log | jq <filter>
This is okay, but changing filters isn't trivial, running the commands and displaying side-by-side isn't trivial etc etc.So say you can develop a decent emacs workflow using that, but once you get a new dev you cannot really pass it on. And if they're not much of a cli person then yea...
Thanks for gistia/json-log-viewer I'll check it out, though it doesn't seem to solve that much it's still interesting.
There's some nice Kibana stuff out there, but it seems single-view-at-a-time focused too