Monitoring¶
settings.py
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {"console": {"class": "logging.StreamHandler"}},
"loggers": {
# everything from this package...
"django_absurd": {"handlers": ["console"], "level": "INFO"},
# ...or quiet one part of it
"django_absurd.scheduler": {
"handlers": ["console"],
"level": "WARNING",
"propagate": False,
},
},
}
Two loggers, configured like any other in Django's
LOGGING:
django.tasks— Django's own task lifecycle.AbsurdBackendemits its signals, so this stays portable across backends.django_absurd— what Absurd did: attempts, durations, worker and beat lifecycle, steps, replays, sleeps, event waits.- One child per module, each levellable on its own —
django_absurd.scheduleris the beat,django_absurd.contextthe durable primitives.
absurd_worker and absurd_beat attach a StreamHandler at INFO so a fresh project
is not silent.
- Naming
django_absurdor one of its children inLOGGINGstops them. - Naming only
rootadds no handler but still raises the level, so aWARNINGroot does not swallow them. - Neither logger is the complete record. Postgres is: the stored result and the queue-state models below.
Query queue state¶
Tasks, Runs, Checkpoints, Events, Waits, and the Queues catalog are public models, spanning every queue.
- Filter by
queue=whenever you can. The views carry no cross-queue index, soqueue=prunes to a single per-queue table, while an unfiltered query — ordering byenqueue_at, or filtering only onstate— scans every queue's table. - They are read-only:
save()/delete()raiseQueueReadOnlyError.
Browse in the admin¶
The same models are registered as read-only admin pages — see Admin.
- Non-default
DATABASE: these models read from the Absurd database, but Django's ownLogEntry, session, andContentTypetables must still exist in"default"— runmigratethere too.