Json Log Viewer is a Python-based command-line tool designed for efficient viewing and real-time monitoring of JSON-formatted log files. It's particularly useful for logs generated by libraries like Winston but is flexible enough to accommodate various JSON log formats.
- Interactive Viewing: Navigate through log events using keyboard controls.
- Detail View: Inspect detailed information of each log event in pretty-printed JSON.
- Real-Time Monitoring: Tail mode for viewing log events as they are generated.
- Reverse Order Display: Shows the most recent log events first.
- Log Format Flexibility: Works well with any JSON log format, expecting at least
timestampandmessagefields.
{
"timestamp": "2021-07-01T12:34:56.789Z",
"message": "Example log message",
... // Other fields
}- Python 3.x
curseslibrary (windows-cursesfor Windows)
- Ensure Python 3.x is installed on your system.
- Clone or download the Json Log Viewer repository to your local machine.
- Install required dependencies:
pip install windows-curses # For Windows users
Run the script with the path to your log file:
python log_viewer.py /path/to/logfile.logFor real-time log updates:
python log_viewer.py /path/to/logfile.log --tail- Up/Down Arrows or 'w'/'s': Move through log events.
- Page Up/Page Down: Scroll faster through log events.
- 'd' Key: Display detailed information of the selected log event.
- 'q' Key: Quit the viewer.
See an example log file in examples/example.log.
Here's an example of viewing a log file:

Here's an example of the details view:

Contributions to Json Log Viewer are welcome. Please submit pull requests or open issues to suggest improvements or report bugs.
Json Log Viewer is released under the MIT License.