A notification in Laravel can fan out to five channels from one dispatch (email, Slack, SMS, a database row, a broadcast), and each of those can succeed or fail independently. That's what tracking has to account for: "the OrderShipped notification went out" isn't a single yes/no, it's five separate deliveries with five different failure modes. A user can get the email and not the SMS, or the database row and nothing else. Monitoring notifications means watching delivery per channel, not per notification.
The three notification events
Laravel fires these events once per channel: NotificationSending before the channel runs (return false from a listener to cancel that channel), then NotificationSent if the channel succeeds or NotificationFailed if it throws. Register the listeners in AppServiceProvider::boot():
app/Providers/AppServiceProvider.php
use Illuminate\Notifications\Events\NotificationSending;
use Illuminate\Notifications\Events\NotificationSent;
use Illuminate\Notifications\Events\NotificationFailed;
use Illuminate\Support\Facades\Event;
public function boot(): void
{
Event::listen(function (NotificationSent $event) {
logger()->info('Notification sent', [
'class' => get_class($event->notification),
'channel' => $event->channel,
'notifiable_type' => get_class($event->notifiable),
'notifiable_id' => $event->notifiable->getKey(),
]);
});
Event::listen(function (NotificationFailed $event) {
logger()->error('Notification failed', [
'class' => get_class($event->notification),
'channel' => $event->channel,
'data' => $event->data,
]);
});
}Queue every notification, then track the queue
Every notification that hits an external service (mail, Slack, SMS) should implement ShouldQueue so it doesn't block the request:
app/Notifications/OrderShipped.php
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
class OrderShipped extends Notification implements ShouldQueue
{
use Queueable;
public function via($notifiable): array
{
return ['mail', 'database'];
}
public function shouldSend($notifiable, $channel): bool
{
// Rate-limit: don't send twice within an hour
$key = "shipped:{$notifiable->id}:{$channel}";
if (cache()->has($key)) return false;
cache()->put($key, true, now()->addHour());
return true;
}
}Queued notifications fail as queued jobs. Pair notification tracking with failed-job monitoring to catch silent delivery failures.
Metrics that matter
- Delivery rate per channel: sent / (sent + failed). Drops indicate provider issues.
- Send count per notification class: Catches runaway sends during incidents.
- Queue lag: Time between dispatch and actual delivery. Rising lag means your workers can't keep up (see monitoring queue latency).
- Failure clustering by recipient: Same user failing across multiple notifications usually means a stale email address or broken webhook.
Gotchas by channel
- Mail: Your mail provider accepting the message doesn't mean it reached the user's inbox. Track bounces via your mail provider's webhook and mark users as undeliverable in your database.
- Slack webhooks: A workspace admin can revoke or rotate the webhook URL, and every send fails until someone updates your config. Alert when all recent Slack sends fail, not on each one.
- SMS: Carriers drop small percentages. Don't alert on single failures, alert on rate drops.
- Database: Rarely fails, since it's an insert into your own database, but users only see it when they log in, so don't make it your only channel.
- Broadcast: Depends on your broadcaster (Pusher, Ably, Reverb). WebSocket disconnects mean delivery isn't guaranteed for offline users.
NightOwl alerts when a send throws an exception it hasn't seen before or runs past its duration threshold; the all-failed and rate-drop checks above need a NotificationFailed listener of your own.