feat(backend): daily request-tagged log files + print job lifecycle logging

Platform v2 step 0.4 (APPS_PLATFORM §10). New core/logging.py:
- root logger -> stderr + <db dir>/logs/xenia-YYYY-MM-DD.log (UTC date,
  /app/data/logs in Docker, $LOG_DIR overrides); files older than the
  system.log_retention_days setting (default 30) are pruned
- line format: UTC ISO time, level, logger, [req= user= device=], message
- RequestContextMiddleware (pure ASGI): request id per request, X-Request-ID
  response header, one http line per request (DEBUG for plain reads)
- auth tags the user via set_log_context; uvicorn loggers routed through ours
Print jobs now log created / attempt / success / failed / abandoned with the
job id, so a missing ticket can be traced. Removed cloud_sync's basicConfig.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 16:31:38 +02:00
co-authored by Claude Opus 5.5
parent e560d93cd5
commit 9fa728c039
9 changed files with 432 additions and 7 deletions
+6
View File
@@ -0,0 +1,6 @@
"""Platform v2 core: cross-cutting services every module uses (APPS_PLATFORM §10).
Agent note: things that belong here are shared by all modules and have no
business meaning of their own (logging, time, errors, access, module registry).
Feature code goes in its module, not here.
"""