Laravel Pail

Dive into your Laravel application's log files directly from the command line with a sleek, filterable CLI.

Tool
Composer
vv1.2.7
924stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
66/100Good
Development Activity64
Maintenance60
Community52
Maturity48
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture82
Code Quality85
Innovation80
Learning Curve88

Laravel Pail is an official Laravel package that lets you tail your application’s logs directly from the console with a single artisan command. Unlike traditional file-based log tailing, Pail works with any log driver, including remote services like Sentry and Flare, by hooking into Laravel’s logging pipeline rather than reading a specific file.

Designed around developer experience, Pail renders a clean, colorized CLI interface and supports rich filtering by message, level, user, and origin (HTTP request, queued job, or console command). It runs as a long-lived process that streams new log entries as they happen, making it a fast way to observe what your application is doing while you develop.

What You Get

  • A php artisan pail command that tails logs live from the console
  • Driver-agnostic capture that works with file, Sentry, Flare, and other log channels
  • Filtering by message content, log level, authenticated user, and request origin
  • A polished, colorized terminal UI built on Termwind

Common Use Cases

  • Watching logs in real time while developing or debugging a feature
  • Filtering to a specific level or user to isolate a problem quickly
  • Observing logs from queued jobs and console commands, not just HTTP requests

Under The Hood

Architecture

Pail registers itself through PailServiceProvider, which wires the PailCommand (src/Console/Commands/PailCommand.php) into Laravel’s artisan runtime. When invoked, a ProcessFactory spawns a subprocess that streams log data; a LoggerFactory attaches a tap to Laravel’s log channels so entries are captured as MessageLogged value objects rather than by scraping a file. Each message carries an Origin (Http, Queue, or Console) value object, and a CliPrinter implementing the Printer contract renders it. An EnsurePcntlIsAvailable guard checks the runtime supports the signal handling the streaming loop relies on.

Tech Stack

PHP 8.2+, built entirely on Laravel’s Illuminate components (console, log, process, support, contracts) spanning Laravel 10 through 13. It uses nunomaduro/termwind for the styled terminal output and symfony/console underneath. Autoloading is PSR-4 under Laravel\Pail, and the package auto-registers its service provider via composer extra.laravel.providers.

Code Quality

The codebase is cleanly decomposed into small, single-responsibility classes (Handler, Files, Options, ValueObjects, Printers, Guards) with contracts for extensibility. It ships a Pest test suite (Feature and Unit) and a CI tests workflow, consistent with the standards of a first-party Laravel package.

API Design

As a tool, the user-facing surface is the single command plus intuitive filter options. Zero configuration is required beyond installing the package, and the polished, self-explanatory CLI gives it a very low learning curve.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search