Skip to main content

Tail and follow JSONL log files with pretty formatting

Project description

TailJLogs

PyPI 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 from PyPI (recommended):

# Using pip
pip install tailjlogs

# Install a specific version
pip install tailjlogs==1.0.1

# Using pipx (isolated CLI install)
pipx install tailjlogs

# Using uv
uv tool install tailjlogs

After installation, tailjlogs will be available in your PATH.

If you prefer to install from GitHub (for development or edge builds), use:

# From source (development)
git clone https://github.com/brianoflondon/tailjlogs.git
cd tailjlogs
uv sync
uv pip install -e .

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.3.tar.gz (63.6 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.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tailjlogs-1.0.3.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tailjlogs-1.0.3.tar.gz
Algorithm Hash digest
SHA256 cac4143d20cf8c420f64c5f65ea65878b43a6c0b7247ad8284b3957b9ada5a74
MD5 09918c48c6f49eee3adea6c1c2cce2c0
BLAKE2b-256 610c336c09aa34facbee631a54db88dde2b025622f0180ba20364623951a48df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tailjlogs-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tailjlogs-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2af172155034e53eaf895596466b653d863dade3ded1ac5c88b680ae8ad1d896
MD5 5ffc45ff295733726c1ce0cfe5eabdb3
BLAKE2b-256 7905439625aa825b1877d0c7a036dae26d99735cfdb3237dd5556550574ea17a

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