chore(logging): Debug-Logs raus + app.log-Rotation gegen volllaufende Platte

- diagnostic/server.js: die beiden Debug-Logs der ai-box-Fehlersuche entfernt
  (roher RX-Dump jeder worker_*/sat_hello-Nachricht + 'worker_hello empfangen'
  bei jedem 30s-Resend). Die Flotte laeuft, der Firehose kann weg.
- bridge/aria_bridge.py: /shared/logs/app.log (JSONL, wuchs unbegrenzt bei
  jeder App-Log-Zeile) rotiert jetzt bei >5 MB auf die letzten 2000 Zeilen
  (Muster wie metrics._maybe_rotate).

RVS selbst loggt nur Lifecycle (Connect/Disconnect) — kein Message-Firehose,
unveraendert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-19 16:47:50 +02:00
co-authored by Claude Opus 4.8
parent 5b952812ee
commit c2472a7958
2 changed files with 11 additions and 8 deletions
+11 -1
View File
@@ -2806,8 +2806,18 @@ class ARIABridge:
"message": payload.get("message", ""),
"stack": payload.get("stack", ""),
}
with (log_dir / "app.log").open("a", encoding="utf-8") as f:
log_path = log_dir / "app.log"
with log_path.open("a", encoding="utf-8") as f:
f.write(json.dumps(line, ensure_ascii=False) + "\n")
# Rotation: app.log waechst sonst unbegrenzt (jede App-Log-Zeile
# haengt an). Bei >5 MB die letzten 2000 Zeilen behalten.
try:
if log_path.stat().st_size > 5 * 1024 * 1024:
tail = log_path.read_text(encoding="utf-8",
errors="ignore").splitlines()[-2000:]
log_path.write_text("\n".join(tail) + "\n", encoding="utf-8")
except Exception:
pass
logger.info("[app-log] %s %s: %s",
line["level"], line["scope"], line["message"][:120])
except Exception as exc: