Setup Options
Nightwatch can ingest Laravel logs in real time. Once configured, logs will appear in the Event Stream inside Nightwatch — fully searchable and correlated with other event types in real time. There are several ways to configure Nightwatch as part of your logging setup. Option 1: Add Nightwatch to the Log Stack (Recommended) If you’re using the defaultstack
driver, you can simply add Nightwatch to the list of channels in your .env
file:
.env
file:
If you have enabled sampling and require all logs to be captured then you should not use Nightwatch as your only log channel. Nightwatch will not capture logs from requests, commands, jobs, and scheduled tasks that are not captured due to sampling.
.env
file:
Log Level Configuration
The Nightwatch logger is configured to respect Laravel’s standard logging behavior. It follows these rules in priority order:NIGHTWATCH_LOG_LEVEL
environment variable- Laravel’s
LOG_LEVEL
environment variable - If neither variable is set, Nightwatch logs all messages of
debug
level and higher sent to thenightwatch
log channel
Log Configuration Example
In the following example, Laravel’s single channel would logwarning
level and higher, while Nightwatch would log error
level and higher.
Log Levels Reference
Log level | Description |
---|---|
debug | Detailed debug information |
info | Interesting events |
notice | Uncommon events |
warning | Exceptional occurrences that are not errors |
error | Runtime errors |
critical | Critical conditions |
alert | Action must be taken immediately |
emergency | Urgent alert |