Skip to main content

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
    Uses rapidfuzz (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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smart_log_reader-1.0.2.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smart_log_reader-1.0.2-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file smart_log_reader-1.0.2.tar.gz.

File metadata

  • Download URL: smart_log_reader-1.0.2.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for smart_log_reader-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1c0a2c6268e46b6717b149e4fbde7c5d8e31c2c2a8097efb83414a185aae588b
MD5 25177715a311ca2e6317d5c5414bd1be
BLAKE2b-256 f8d10fb0212840be624f2c1f2ea5ecb679b876c7ef3a2424adbfe8d686dc0e6d

See more details on using hashes here.

File details

Details for the file smart_log_reader-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for smart_log_reader-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c6ba1a85eab04cf980e40298ae1c16c27ceafee1434d55e331cc9bb5900595bd
MD5 293ddce164e325575d9b1f2ff9aae720
BLAKE2b-256 1e5e9bd0327004712e17d26ebcf30a62336499125a44500227f87b61774fbe3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page