Cheap Centralized Logging for 3 Small SaaS Cron Jobs — Rollback Evidence
TL;DR: Centralize structured events from the web app, worker, and cron runner, then make rollback evidence a required part of every release evaluation. For a small SaaS, a plain REST logging service is a reasonable low-complexity choice when the goal is searchable application and job history without operating a full ELK stack. Keep a separate heartbeat monitor for jobs that never start, and do…
This write-up explores the process of centralizing structured events from a web application, worker processes, and cron jobs for a small SaaS application. The goal is to maintain a searchable history of application and job activity without the overhead of a full ELK stack. The system should only include essential fields such as service, environment, log level, request ID, and release information. A heartbeat monitor should be included for jobs that never start.
To ensure rollback evidence is readily available, a small release scorecard can be used to validate that the logging format remains consistent across different releases. This avoids the need to manually compare log lines during a rollback process.
The example provided demonstrates how to send a structured event through a verified ingestion route using Python. The implementation includes retry behavior in case of rate limits, ensuring idempotency through the use of a hash of the event data and environment variables. This structured logging approach enables a support team to quickly correlate customer support tickets with specific web application requests, background jobs, and deployed versions of the application.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.