config/nightowl.php after running php artisan nightowl:install. Most values are driven by environment variables — the defaults are tuned for a single-instance deployment doing up to a few thousand requests per second.
Database connection
Use the same credentials you entered when creating the app in the dashboard — the hosted UI uses them to read the telemetry your agent wrote.
Sharing one database across environments
NightOwl stamps anenvironment column (your APP_ENV) on every row, so you can point several app environments (local, staging, production) at one NightOwl database and filter them apart in the dashboard. The environments are separated only by that column; the nightowl_* tables themselves are shared. (Unrelated to table partitioning — see Data management for that.)
nightowl:install and nightowl:migrate track their migration history inside the NightOwl database, so they’re idempotent across every environment that shares it. Run php artisan nightowl:migrate as part of each deploy:
- the first environment to deploy creates the tables;
- the rest are no-ops;
- when a package upgrade adds a migration, it applies on whichever environment deploys first.
nightowl_* tables but no NightOwl migration history (for example it was created by an older version, or by your app’s php artisan migrate), the command adopts the existing schema as a baseline instead of trying to recreate it — so you never hit relation "nightowl_requests" already exists.
By default NightOwl’s migrations are not bundled into your app’s
php artisan migrate. Manage the schema with nightowl:migrate (or nightowl:install). See NIGHTOWL_RUN_MIGRATIONS below if you want the legacy ride-along behavior.nightowl:migrate, php artisan nightowl:agent warns at startup that the schema is behind (and keeps running) rather than failing silently mid-drain. So wiring nightowl:migrate into your deploy is the way to keep the schema current.
Agent runtime
The async server enables
SO_REUSEPORT automatically on Linux, so multiple agents can bind the same port without extra configuration — see Running multiple instances.
Authentication
For a standalone install, set
NIGHTOWL_TOKEN only. For parallel mode, set both: NIGHTOWL_TOKEN is what the NightOwl agent verifies against, NIGHTWATCH_TOKEN is your Nightwatch token used by the Nightwatch SDK to reach Laravel Cloud’s hosted ingest in parallel.
Drain pipeline
Issue lifecycle
See throughput tuning for how to size these.
Sampling
Sampling is handled upstream bylaravel/nightwatch before the payload reaches the agent. Configure it in your customer app’s .env:
Redaction
PII redaction is handled upstream bylaravel/nightwatch before the payload reaches the agent. Configure it in your customer app’s .env:
Retention and caching
Full retention and pruning strategy lives in Data management.
Parallel mode
See Running alongside Nightwatch.
Artisan commands
The agent command accepts
--driver=async|sync. async is the default and required for multi-worker drain; sync is a single-process fallback for hosts without pcntl/posix.