feat: structured auth logging for log-based analytics #105
Labels
No labels
a11y
backlog
beta-feedback
bug
enhancement
feature-request
frontend
needs-triage
question
vue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/peregrine#105
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add structured auth-type logging to API endpoints so traffic can be analysed by log parsing rather than relying entirely on web analytics.
What Snipe did (reference implementation)
Add
logging.basicConfig(level=logging.INFO, format="%(levelname)s:%(name)s: %(message)s")so app-level logs appear indocker logsalongside the Uvicorn access log (previously suppressed by missing root handler).Endpoints to instrument
/api/sessionor equivalent): logauth=+tier=on every call; log UUID on new guest creation.auth=,tier=, and key request params.Expected log output
Why
Structured key=value log lines are grep/awk-friendly and can be shipped to Loki + Grafana later without changing the format. Enables understanding of anon vs guest vs authenticated usage split without client-side tracking.
Reference
Circuit-Forge/snipe@873b9a1 — working implementation.