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.4.tar.gz (64.1 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.4-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tailjlogs-1.0.4.tar.gz
  • Upload date:
  • Size: 64.1 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.4.tar.gz
Algorithm Hash digest
SHA256 5bdfd6dba10491bdb56df063a4729c990def8976fd6646f259abf99101eec649
MD5 7410b7bf847861b82561d3df640ad5ff
BLAKE2b-256 43c5d0607bf5472d2afca4bd671bf5d7f6929940d803d68df4c0f2aee6105cca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tailjlogs-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dccdbc66bc4d9e62a6770aefc05094ea3288fe38a8b6010bd807c822c7d6794c
MD5 f76b183b0cc5b6fda6dd4c1b0575909a
BLAKE2b-256 75618afe27bb49a9455fd44f5a7ad49b79f5a9b42a659debba6a14a4abf34561

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