Skip to main content

Tail and follow JSONL log files with pretty formatting

Project description

TailJLogs

Tests

A command line tool to tail and follow JSONL log files with pretty formatting.

Features

  • 📋 Display JSONL logs in a clean, readable format similar to docker logs
  • 🔄 Follow mode (-f) for real-time log monitoring
  • 🎨 Colorized output by log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  • 🔍 Filter by log level (-l WARNING)
  • 🔎 Grep pattern matching (-g "error|failed")
  • 🚫 Exclude patterns (-G "healthcheck")
  • 📁 Directory support - merge multiple log files by timestamp
  • ⚡ Async file reading for performance

Installation

Standalone Installation (Recommended)

Install TailJLogs as a standalone CLI tool available system-wide:

# Using uv (fastest)
uv tool install git+https://github.com/brianoflondon/tailjlogs.git

# Using pipx (alternative)
pipx install git+https://github.com/brianoflondon/tailjlogs.git

After installation, tailjlogs will be available in your PATH.

From PyPI (when published)

uv tool install tailjlogs
# or
pipx install tailjlogs

From Source (for development)

git clone https://github.com/brianoflondon/tailjlogs.git
cd tailjlogs
uv sync

# Run directly
uv run tailjlogs --help

# Or install in editable mode
uv pip install -e .

Updating

# Using uv
uv tool upgrade tailjlogs

# Using pipx
pipx upgrade tailjlogs

Uninstalling

# Using uv
uv tool uninstall tailjlogs

# Using pipx
pipx uninstall tailjlogs

Usage

# Show last 50 lines and follow
tailjlogs logs/app.jsonl -f

# Show last 100 lines with WARNING or higher
tailjlogs logs/app.jsonl -n 100 -l WARNING

# Filter by regex pattern and follow
tailjlogs logs/app.jsonl -f -g "error|failed"

# Exclude health check logs
tailjlogs logs/app.jsonl -f -G "healthcheck"

# Tail a directory (merges all .jsonl files by timestamp)
tailjlogs logs/ -n 100 -f

# Show version
tailjlogs --version

Options

Option Short Description
--follow -f Follow the log file for new entries (like tail -f)
--tail -n Number of lines to show from the end (default: 50)
--level -l Minimum log level to display (DEBUG, INFO, WARNING, ERROR, CRITICAL)
--grep -g Filter messages by regex pattern (include matches)
--grep-exclude -G Exclude messages matching regex pattern
--no-color Disable colored output
--verbose -v Use verbose output format
--extras -e Show extra fields in log entries
--version -V Show version and exit

Expected JSONL Format

TailJLogs expects log entries in JSONL format with the following fields:

{
  "timestamp": "2025-01-16T10:30:45.123456Z",
  "level": "INFO",
  "message": "User logged in",
  "module": "auth",
  "line": 42,
  "logger": "app.auth",
  "function": "login"
}

Development

Setup

git clone https://github.com/brianoflondon/tailjlogs.git
cd tailjlogs
uv sync

Running Tests

# Run all tests
uv run pytest

# Run with verbose output
uv run pytest -v

# Run specific test file
uv run pytest tests/test_formatting.py

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

tailjlogs-1.0.1.tar.gz (61.5 kB view details)

Uploaded Source

Built Distribution

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

tailjlogs-1.0.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file tailjlogs-1.0.1.tar.gz.

File metadata

  • Download URL: tailjlogs-1.0.1.tar.gz
  • Upload date:
  • Size: 61.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for tailjlogs-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0f67f9a298a78298de9a0534543771bc3c8fc64596fb58b49c699dadf74ac16b
MD5 912f10ef8fc510af7cb5a1d971bb3847
BLAKE2b-256 d69a426152e2c3e9ad7a72799fd8dd7945fa5991bf4c5e04e16e4c1486b282e2

See more details on using hashes here.

File details

Details for the file tailjlogs-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: tailjlogs-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for tailjlogs-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e4e3276f76667131ce4633c3744df8e0bfb97f2f0845fc99d12682370b7f9a3
MD5 0a4d8789ea517894caaa7523562f038c
BLAKE2b-256 283186abad1cc2c7f809027315a5ee7f1cdf3de5f43f756977b129c62ba62846

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