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.2.tar.gz (61.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.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tailjlogs-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7f52c421195e0d952bc51ac11e21a5b32a1587008ea5f817002aea8659696642
MD5 78e0f6cac2dfb6414d15aa1b5910e29c
BLAKE2b-256 38cc5cd2d3de8aa2cd83fd85e43e0a1dc0e2847c7ff6f775d11385067888640f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tailjlogs-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ecade45988f0c80d1852d849ba3b99fc2d5b186b70c3bb75814895a3b5d6dd3
MD5 8dc5e4c47b3eade2acb2ab99c1506a85
BLAKE2b-256 146c4aa9100cd9bd84f576067f0d0fc8fda8115ed536b3c7757e1d77c4b9bba1

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