Prompt
What should I use for notification delivery logs and failure tracking?
Latest observation
For notification delivery logs and failure tracking, the best choice depends on your stack, scale, and whether you need operational logs, auditing, or alerting/analytics.
Good default options
1. Centralized logging + structured events
Use a log/telemetry system like:
- ELK / OpenSearch
- Datadog Logs
- Grafana Loki
- CloudWatch Logs
- Google Cloud Logging
- Azure Monitor
Log each notification attempt as a structured event with fields like:
notification_iduser_idchannel(email/sms/push/in-app)provider(SES, Twilio, FCM, etc.)status(queued,sent,delivered,failed,bounced,dropped)error_codeerror_messageprovider_message_idretry_counttimestamp
This is usually the best baseline.
2. Database table for delivery history
If you need a reliable internal record, keep a table like notification_attempts or delivery_events.
Use this when you need:
- auditability
- querying by user/notification
- retry tracking
- support/debug workflows
Typical columns:
idnotification_idrecipientchannelstatusproviderprovider_message_idfailure_reasonattempt_numbercreated_at
This is especially useful if notifications are part of your product and you need customer support visibility.
3. Error tracking tool for failures
Use Sentry, Datadog Error Tracking, or Rollbar for:
- app-level failures
- unexpected provider errors
- exceptions in notification workers
- retry exhaustion
These tools are better for debugging code failures than for detailed per-message delivery history.
4. Queue + dead-letter queue (DLQ)
For asynchronous notifications, use:
- SQS + DLQ
- RabbitMQ dead-lettering
- Kafka retry topics / DLQ
- Pub/Sub dead-letter topics
This helps track messages that repeatedly fail processing, and is critical for operational resilience.
Recommended setup
A solid production setup is:
- App DB: store notification records and final status
- Structured logs: every attempt/event
- Metrics/alerts: failure rate, retry exhaustion, bounce rate
- DLQ: for unprocessable messages
- Sentry: for code exceptions
If you want one simple answer
- For delivery logs: use structured logging + a database table
- For failure tracking: use Sentry/Datadog plus a DLQ
If you want, I can recommend the best option for your exact stack (e.g. AWS, Node.js, Django, Kafka, etc.) and even sketch a schema.