3 ms·
Ask HN: What do you use to view logs?
Looking for solutions out there, or recommendations for macOS. Specifically, static log files (structured JSON) that is easy to filter and has color coding (log levels).
What I am finding is that there are mainly "tail" type log viewers via the terminal, or cloud based. I'm looking for something local I can install.
- cpach 4y agoI guess many people use Graylog, Splunk or similar web-based systems (which can be self-hosted if you like) and are content with that. Not sure if there are any readymade applications for using locally on your Mac. Maybe you can hack something together with jq + Bash + awk etc? These tools might also be useful: https://kantord.github.io/emuto/ https://kantord.github.io/emuto/ https://github.com/antonmedv/fx https://github.com/antonmedv/fx Best of luck!
- iimpact 4y agoappreciate the info.. will check these out
- toomuchtodo 4y agoGraylog for centralized logging, jless locally.
- iimpact 4y agojless looks pretty awesome.. using lnav right now, but jless has a lot more pre-built json handling from what I can tell
- runjake 4y agoGraylog. It’s surprisingly quick and easy to get going. Here’s a good starter video. https://www.youtube.com/watch?v=rtfj6W5X0YA https://www.youtube.com/watch?v=rtfj6W5X0YA
- skinnymuch 4y agoIs http://www.logtailapp.com/ http://www.logtailapp.com/ too simple or would it work?
- iimpact 4y agoHow do you like this? I did come across it when I was searching
- skinnymuch 4y agoSorry for late reply if you see this at all. I like it. I assume there isn’t an alternative so I’m forgiving of any friction or limitation as it has enough of the basics to do most things. The main thing id like is better UX with filtering/highlighting things. It does support those things though
- throwawayninja 4y agoLame but powerful option: `tail -f /logfile.log | grep -A10 -B10 <interesting thing>`. (prints 10 lines before & after search lines). The most powerful feature I've had in log management is the ability to search for what was interesting, and no tool can provide you a "this is interesting" button. If you've got performance concerns ripgrep is a drop-in grep replacement that's very fast.
- tstack 4y agoThe Logfile Navigator (https://lnav.org https://lnav.org) is a TUI for viewing log files that can be configured to process structured JSON files. It has quite a few features, like filtering and color coding. The documentation for writing a format file is here -- https://docs.lnav.org/en/latest/formats.html https://docs.lnav.org/en/latest/formats.html The format file tells lnav what common fields are in the log messages and how to format them into plaintext for display. Here's an example configuration for JSON logs -- https://github.com/tstack/fullsail_lnav_config/blob/master/fullsail_log.json https://github.com/tstack/fullsail_lnav_config/blob/master/f...