Monitor and Control Schedules, Queues, and Errors in Laravel with Watchtower

Last updated on by

Monitor and Control Schedules, Queues, and Errors in Laravel with Watchtower image

Watchtower is a Laravel package that puts scheduled tasks, queues, jobs, and exceptions on a single dashboard built to stay running in production. At a glance, it gives you:

  • One dashboard for scheduled tasks, queues, jobs, and exceptions
  • Actions, not just visibility — run a task on demand, bulk-retry failed jobs, and mark errors resolved
  • Any queue driver (database, Redis, or SQS), with no Redis dependency
  • Awareness of single-database, multi-database, and multi-tenant setups
  • Production-safe recording with deferred writes, sampling, and automatic pruning
  • Gate-based access control in the style of Horizon and Telescope
  • Optional Slack, webhook, or email alerts

Three Tabs for Background Work

The dashboard is split into three views. The Schedule tab lists every scheduled task with its cron expression written in plain English, alongside run history, durations, and missed-run detection — and a "Run now" button to dispatch a task immediately.

The Queues & Jobs tab puts live queue metrics next to the failed-jobs table, where you can retry a single job or bulk-retry by exception type or time window.

The Errors tab groups exceptions by type and count, with full stack traces, request and job context, and resolve/reopen controls.

None of this is tied to a particular driver: queues can run on database, Redis, or SQS, and Watchtower reads from a dedicated connection when your app spans multiple databases or tenants.

Production Safety by Default

Recording activity on every request and job could easily become a tax on the app it's watching, so Watchtower defers its writes to Laravel's terminating() callback to keep them off the request path. High-traffic apps can record only a fraction of activity with a sampling rate while still capturing every failure and schedule run, and all stored fields are truncated to bound row sizes. A daily watchtower:prune command clears aged records on per-type retention windows — 30 days for schedule runs and exceptions, 7 days for queue records by default.

Most of this is tuned through environment variables. A few of the available settings:

WATCHTOWER_ENABLED=true
WATCHTOWER_DB_CONNECTION=monitoring
WATCHTOWER_SAMPLING_RATE=0.25
WATCHTOWER_AFTER_RESPONSE=true
WATCHTOWER_RETAIN_EXCEPTIONS=30

Setting WATCHTOWER_ENABLED=false is a kill switch that stops recording instantly, and ignore lists for jobs, commands, and exceptions keep noisy items off the dashboard.

Authorization

By default the dashboard is restricted to the local environment; opening it up elsewhere means defining the viewWatchtower gate:

use Illuminate\Support\Facades\Gate;
 
Gate::define('viewWatchtower', function ($user) {
return $user !== null && $user->isAdmin();
});

There's also a fluent callback if you'd rather keep the authorization logic with the package:

use Watchtower\Watchtower;
 
Watchtower::auth(fn ($request) => $request->user()?->isAdmin());

Unauthorized requests receive a 403 response.

Optional Alerts

Watchtower can notify you when a scheduled task fails, a run is missed, or failed jobs cross a threshold (25 within 60 minutes by default). Alerts stay off until you set WATCHTOWER_ALERTS_ENABLED=true, and they can go out over Slack, a generic webhook, or email. The checks run from the watchtower:monitor command, which you schedule alongside your other tasks:

$schedule->command('watchtower:monitor')->everyFiveMinutes();

Watchtower requires PHP 8.2+ and Laravel 11 or 12, and is MIT-licensed. You can find the source, configuration reference, and installation details on GitHub.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

The latest

View all →
Laravel Quota: Usage Budgets for Calendar Periods image

Laravel Quota: Usage Budgets for Calendar Periods

Read article
Find the Security Vulnerabilities in Your Laravel App with Sensagraph image

Find the Security Vulnerabilities in Your Laravel App with Sensagraph

Read article
Uvora: A macOS Menu Bar App for Finding Laravel Projects image

Uvora: A macOS Menu Bar App for Finding Laravel Projects

Read article
Passwordless Sign-In with Fortify Two-Factor Support in Laravel image

Passwordless Sign-In with Fortify Two-Factor Support in Laravel

Read article
Intercept: Middleware Guardrails for Laravel AI Agents image

Intercept: Middleware Guardrails for Laravel AI Agents

Read article
AI Review for Laravel Upgrades image

AI Review for Laravel Upgrades

Read article