Intelligent, extensible log reader and analyzer with color-coded output and smart error grouping.
Project description
🐍 smart-log-reader
Stop grep-ing blindly.
smart-log-reader is an intelligent, terminal-first log analyzer that instantly parses massive log files, groups similar errors using fuzzy matching, and outputs beautifully formatted, color-coded summaries directly in your terminal.
When the terminal isn't enough, export a fully interactive HTML dashboard and serve it securely from your remote server to your local machine via an SSH tunnel.
🚀 Installation
Because this is a standalone CLI tool, do not install it globally with pip.
Use pipx to install it in an isolated environment so it never conflicts with your system dependencies.
pipx install smart-log-reader
🔥 Quick Start: Real-World Scenarios
1. The "Server is on fire" check (Auto-detects format, groups errors)
smart-log-reader -f /var/log/syslog -l ERROR
2. The "Odoo is crashing" audit (Filter by time and keyword)
smart-log-reader -f odoo-server.log -t odoo -k "psycopg2" -s "2024-03-05 10:00:00"
3. Generate an interactive HTML report and serve it securely
smart-log-reader -f production.log -t python -x html --serve
✨ Core Features
-
Format Auto-Detection
Automatically recognizes Python, Django, Flask, Odoo, Nginx, Apache, PostgreSQL, MySQL, and JSON-line logs. -
Intelligent Error Grouping
Usesrapidfuzz(85% threshold) to group thousands of repetitive tracebacks into unique "Core Issues", showing you exactly what broke and how often. -
Zero-Memory Streaming
Processes multi-gigabyte log files line-by-line without eating up your server's RAM. -
Multi-line Unification
Automatically stitches stack traces and JSON payloads back together into single, readable entries.
🛡️ The Killer Feature: Secure HTML Export & Tunneling
When debugging remote production servers, downloading gigabytes of logs is tedious and risky.
smart-log-reader solves this natively.
With --serve, it:
- generates a self-contained HTML dashboard
- starts a minimal, localhost-only HTTP server on the production machine
- lets you view it securely via SSH tunnel
Your log data never leaves the server.
How to use it
On the remote server:
smart-log-reader -f /var/log/nginx/error.log -x html --serve --port 8080
On your local machine:
ssh -L 8080:127.0.0.1:8080 your-user@your-remote-server.com
Then open in your browser:
http://localhost:8080/report_name.html
Alternative (LAN / VPN only): use
--serve-public→ gets a token-protected URL, no SSH tunnel needed.
🛠️ CLI Reference
| Flag | Description |
|---|---|
-f, --file |
(Required) Path to the log file |
-t, --log-type |
Force parser: auto, python, django, flask, odoo, nginx, apache, postgresql, mysql, mariadb, jsonline |
-l, --level |
Filter by severity: ALL, ERROR, WARNING, INFO, DEBUG |
-k, --keyword |
Filter logs containing a specific string or regex pattern |
-s, --start-time |
Start time filter (e.g. YYYY-MM-DD HH:MM:SS) |
-e, --end-time |
End time filter |
-x, --export |
Export format: none, json, html |
--serve |
Starts a localhost-only HTTP server for the HTML export |
--serve-public |
[LAN/VPN ONLY] Binds server to 0.0.0.0 with secure URL token |
-p, --port |
Specify port for the HTTP server (defaults to random available port) |
-g, --no-group-errors |
Disables fuzzy error grouping |
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smart_log_reader-1.0.0.tar.gz.
File metadata
- Download URL: smart_log_reader-1.0.0.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f325273f803896a1979f116ba1a73877cdbdfd26b9ee07e17b954eb84d0b80a
|
|
| MD5 |
b77b7de2274ae8d45544558502bf0d68
|
|
| BLAKE2b-256 |
554cb2697d77b6aa7ab7943d83d0adc8376d82187bc25660d552dfefb52a3f96
|
File details
Details for the file smart_log_reader-1.0.0-py3-none-any.whl.
File metadata
- Download URL: smart_log_reader-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d638b9d1616e50fc0c506f594ad9e0c522f6eb967eeed6822ec4efdc5ecc8340
|
|
| MD5 |
4e3ceeae712fda572b5b0cab7856e501
|
|
| BLAKE2b-256 |
56a52b657a3f65cc303ff6d759944809e81197bcb974ae282b7a5953f8bc32a8
|