A lightweight structured log viewer with live streaming and filters.
Project description
Log4Lab
A lightweight structured log viewer with live streaming, filtering, and rich content rendering.
Log4Lab is a web-based dashboard for viewing and analyzing structured JSON logs in real-time. It provides a clean interface for monitoring application logs with live updates, making it easy to track experiments and debug issues.
Installation
Using pipx (Recommended)
Install log4lab as an isolated application:
pipx install log4lab
Using pip
pip install log4lab
From source
git clone https://github.com/tlamadon/log4lab.git
cd log4lab
pip install -e .
Quick Start
-
Start the web interface:
log4lab serve logs/app.log
Then open http://localhost:8000
-
View logs in terminal:
log4lab tail logs/app.log
-
Export to HTML:
log4lab export logs/app.log -o report.html
Log Format
Log4Lab expects JSONL format (one JSON object per line):
{"time": "2025-02-03T10:30:00Z", "level": "INFO", "section": "train", "message": "Training started"}
{"time": "2025-02-03T10:30:05Z", "level": "WARN", "section": "data", "message": "Missing data point"}
{"time": "2025-02-03T10:30:10Z", "level": "ERROR", "section": "model", "message": "Model failed to converge"}
With Rich Content
Log4Lab can display various file types when you include a cache_path field:
{
"time": "2025-02-03T10:30:00Z",
"level": "INFO",
"section": "train",
"message": "Training complete",
"cache_path": "artifacts/results.png",
"run_name": "experiment_1",
"accuracy": 0.95
}
Supported content types:
- Images: PNG, JPG, SVG, etc. (displayed inline)
- Code files: Python, JavaScript, JSON, YAML, etc. (syntax highlighted, collapsible)
- Markdown: .md files (rendered as HTML, collapsible)
- PDFs: Embedded viewer
- Other files: Download links
Core Fields
time: Timestamp in ISO 8601 formatlevel: Log level (INFO, WARN, ERROR, DEBUG)section: Component or module namemessageormsg: Main log messagecache_path: Path to artifact filerun_name: Name of the run collectionrun_id: Unique run identifier
Any additional fields are shown in the expandable JSON view.
Commands
Serve (Web Interface)
log4lab serve [LOGFILE]
# Options:
--host 0.0.0.0 # Bind to all interfaces (default: 127.0.0.1)
--port 3000 # Custom port (default: 8000)
--reload # Auto-reload for development
Tail (Terminal)
log4lab tail [LOGFILE]
# Options:
--level ERROR # Filter by log level
--open-images # Open images automatically
Export
log4lab export [LOGFILE] -o output.html
# Options:
-o, --output FILE # Output file path
-t, --title TEXT # Custom page title
--no-embed-images # Don't embed images (smaller file)
Filtering
The web interface supports:
- Level filtering: Dropdown with all levels found in logs
- Text filters: Section, run name, run ID (partial matching)
- Time range: Last 1m, 5m, 30m, 1h, 6h, 24h
- URL filters: Bookmark and share filtered views
# Filter by error logs from last hour
http://localhost:8000/?level=error&time=3600
# View specific run
http://localhost:8000/?run_name=experiment_1
Use Cases
Machine Learning: Track training runs with metrics and plots
{"run_name": "resnet_training", "epoch": 10, "loss": 0.23, "cache_path": "plots/loss.png"}
Debugging: Monitor distributed systems across components
{"section": "api", "level": "ERROR", "message": "Connection timeout", "duration_ms": 5000}
Research: Document experiments with artifacts
{"run_name": "param_sweep", "message": "Testing lr=0.001", "cache_path": "results.pdf"}
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
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 log4lab-0.1.1.tar.gz.
File metadata
- Download URL: log4lab-0.1.1.tar.gz
- Upload date:
- Size: 35.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c177877b6dd83b98330343b01f8a6356c00919514d48591583e10ac74879326a
|
|
| MD5 |
99004e5709d76bff4ec994529e137916
|
|
| BLAKE2b-256 |
ae3f513b87e473fe67dfc0775d828d2cb1674a136f68dbcb5b54e79c0723aab7
|
Provenance
The following attestation bundles were made for log4lab-0.1.1.tar.gz:
Publisher:
publish.yml on tlamadon/log4lab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
log4lab-0.1.1.tar.gz -
Subject digest:
c177877b6dd83b98330343b01f8a6356c00919514d48591583e10ac74879326a - Sigstore transparency entry: 924473504
- Sigstore integration time:
-
Permalink:
tlamadon/log4lab@592e03104e72472f0e543da52208ef65e0ad8ed1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/tlamadon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@592e03104e72472f0e543da52208ef65e0ad8ed1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file log4lab-0.1.1-py3-none-any.whl.
File metadata
- Download URL: log4lab-0.1.1-py3-none-any.whl
- Upload date:
- Size: 35.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
580f86c90253e0126b2655aad7352feb40b78e438b4e9c81f90279f4725c69c8
|
|
| MD5 |
c41f1ac5f9871dd1a44de6afc59b68c5
|
|
| BLAKE2b-256 |
c2bcae4c9146149d673173b037b23ec1a24ee8783b4e2da99444eb171b848e04
|
Provenance
The following attestation bundles were made for log4lab-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on tlamadon/log4lab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
log4lab-0.1.1-py3-none-any.whl -
Subject digest:
580f86c90253e0126b2655aad7352feb40b78e438b4e9c81f90279f4725c69c8 - Sigstore transparency entry: 924473505
- Sigstore integration time:
-
Permalink:
tlamadon/log4lab@592e03104e72472f0e543da52208ef65e0ad8ed1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/tlamadon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@592e03104e72472f0e543da52208ef65e0ad8ed1 -
Trigger Event:
push
-
Statement type: