Laravel Pail
Dive into your Laravel application's log files directly from the command line with a sleek, filterable CLI.
Repository Health
Technical Analysis
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 pailcommand 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.
Used by 2 apps in this directory
Coolify
Devops · Hosting Control Panel
Open-source self-hosted PaaS — deploy apps, databases and 280+ services on your own servers with no vendor lock-in
Databasement
Databases · Devops · Developer Tools
Self-hosted database backup manager with a web UI for scheduling, encrypting, and restoring MySQL, PostgreSQL, MongoDB, SQL Server, SQLite, Firebird, and Redis to S3, SFTP, Samba, or local storage.