Forge is the reason a lot of Laravel apps never set up real monitoring: it shows you a CPU graph, supervises your workers, emails you when a deploy fails, and that's enough to feel covered. It isn't. Forge operates at the server layer. It knows the box is healthy, not whether your checkout endpoint is slow, which query is the N+1, or that an exception started firing after this morning's deploy. Nothing about Forge gets in the way of adding the application layer: the agent runs as one more background process.
What Forge covers and doesn't
| Layer | Forge provides | You still need |
|---|---|---|
| Server metrics | Server charts (depend on your provider) | Application-layer telemetry |
| Queue workers | Horizon / queue:work background processes | Per-class duration, attempts and failures |
| Scheduled tasks | schedule:run cron, once you enable the scheduler | Invocation history, duration, exception capture |
| Deploy health | Deploy log + email on failure | Request latency and exceptions after each deploy |
| Logs | Access via UI (tail) | Aggregation, search, retention |
| Exceptions | Nothing | Grouped exceptions with alerts |
Install NightOwl on a Forge server
On your local machine
composer require nightowl/agent
php artisan nightowl:install
git pushDeploy via Forge as usual. Then add the agent as a background process in Forge's dashboard:
- Processes → Add background process (on the server or the site)
- Command:
php artisan nightowl:agent - Working directory:
/home/forge/yourapp.com/current(new sites use zero-downtime deploys, so the live code sits undercurrent/) - User:
forge - Stop seconds:
30, so the agent has time to shut down cleanly
Forge's Supervisor restarts the agent if it crashes. queue:restart doesn't touch it, so restart it from your deploy script (below) to pick up each new release.
Separate DB server for telemetry
NightOwl writes telemetry to a PostgreSQL database you own. Two sensible setups on Forge:
- Same DB as the app: simplest. Works for small apps. Telemetry writes share capacity with your application queries.
- Dedicated DB server: a separate Forge-managed PostgreSQL instance for telemetry only. Keeps the app database's hot path isolated, at the cost of one more server from your provider.
Use Forge's existing supervision for workers
Forge's queue workers (Horizon or plain queue:work) run as Supervisor-managed background processes. The Nightwatch package attaches to them automatically, with no extra configuration needed. Every job attempt fires events the package captures and ships to the NightOwl agent.
Scheduled task monitoring
Once you turn on the scheduler for the site, Forge adds a cron entry that runs php artisan schedule:run every minute. Without it, no scheduled task runs. The Nightwatch package records each scheduled task invocation automatically, and NightOwl surfaces them in the scheduled-tasks dashboard with full invocation history (status, duration, exception capture, skipped runs from withoutOverlapping). Runs skipped by onOneServer aren't recorded.
Deploy scripts for Forge
A zero-downtime Forge deploy script with one NightOwl-specific line. The agent runs as its own Supervisor-managed background process, so restart it after $ACTIVATE_RELEASE() to run the new release. Replace 12345 with the background process ID Forge shows.
$CREATE_RELEASE()
cd $FORGE_RELEASE_DIRECTORY
$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
$FORGE_PHP artisan optimize
$FORGE_PHP artisan migrate --force
$ACTIVATE_RELEASE()
$RESTART_QUEUES()
# Restart the NightOwl agent on the new release
sudo -S supervisorctl restart daemon-12345:*