A FIELD GUIDE TO LARAVEL · VOLUME II · THE ECOSYSTEM
ENTRY II.34 · LOG TAILING
Pail
Laravel\Pail · Package · first recorded 6 October 2023, v1.0.0-beta.1 on Packagist
A log tail for the terminal that works with any log driver, Nightwatch, Sentry or Flare included, because it listens for log events and keeps its own temporary files under storage/pail, rather than tailing the app's log file. One command, four filters, Ctrl+C to stop.
Specification
KindDev-only package; a command, nothing resident
InterfaceListens for MessageLogged in-process, so the configured driver does not matter
Runs onThe terminal during development; needs the PCNTL extension
Installed bycomposer require --dev laravel/pail
Voicepail · pail -v · pail -vv
Scales byNot a concern: each open tail gets its own file in storage/pail
RangeCloud: n/a: local tool. Cloud has a Logs tab of its own Forge, VPS: over SSH, only if dev packages and PCNTL are installed Vapor: no. Pail switches itself off on Vapor; there is no terminal on Lambda
Neighbours
Telescope stores each entry in your database to browse at /telescope. Nightwatch records production in a hosted service, and Cloud shows an environment's logs in its dashboard. Pail keeps nothing: it listens to the logger and shows each entry as it passes, in a terminal.
require-dev: laravel/pail php artisan pail storage/pail/ PCNTL in php -m
Fig. II.34.1 · One log line, tailed
Parts
1Log call.Log::info('User {id} failed', ['id' => 1]) anywhere in the app: a request, a queued job, a command.
2Channel stack. The configured drivers still receive the entry: single, daily, Slack, Nightwatch, Sentry, Flare.
3Pail tap. A listener on every log event; it writes only while a tail is open, whatever driver is configured.
4Filters.--filter on type, file, message and trace; --message; --level=error; --user=1 for one signed-in user.
5Terminal. Each entry with its level, time and origin. -v stops truncation; -vv adds the exception stack trace.
Hidden joinery
--user matches entries written while that user was signed in, read from the auth context at write time. -v only widens the line; -vv is what shows a stack trace. PCNTL lets Ctrl+C be trapped so the tail's file is removed. Each tail is a .pail file that every app process on the machine writes to and the command reads.
Every line checked against the 13.x logging docs and laravel/pail source on 2026-10-08.