Configuration
Configure the agent to customize what is captured.
Manually Reporting Exceptions
Nightwatch automatically listens to all exceptions reported within your Laravel application:
If you’re not seeing an exception in your Nightwatch dashboard, you can explicitly report it using the facade:
📘 This is only needed in rare cases where exceptions are not captured automatically.
Customizing User Details
Nightwatch can capture information about the currently authenticated user. By default, it collects the user’s name
and email
attributes and uses them as the display name and username.
If you want to customize what’s captured — for example, using a user’s first_name
and last_name
instead — you can do so in your AppServiceProvider
using the Nightwatch::user
method.
Custom User fields
Omitting User fields
You can choose to exclude one or both fields by omitting them from the returned array:
Monitoring Guzzle Requests
Nightwatch automatically captures outgoing HTTP requests made via Laravel’s Http client. If you’re using Guzzle directly, you can still capture these requests by attaching Nightwatch’s middleware to your Guzzle stack.
Requests made by $client
will now be monitored by Nightwatch.
Customizing the Agent Port
By default, the Nightwatch agent listens on port 2407
. You can change this by setting a different ingest URI and using the --listen-on
flag when starting the agent.
To run the agent on port 2408
, update your .env file:
Then start the agent using the matching port:
Running Multiple Agents
If you’re running more than one Laravel application or environment on the same server, you can run multiple Nightwatch agents in parallel — each on a unique port.
Each agent must use a different port. See Customizing the Agent Port for instructions on how to set this per instance.
Here’s an example setup running two agents in the one server: