Bringing Live Application Logs to Reel Quick
Описание и применение
Reel Quick внедрил централизованный просмотр логов в реальном времени. Логи из FastAPI и воркеров записываются в Redis Streams и передаются на фронтенд через SSE. Это упрощает отладку распределенной системы.
Задача
Debugging a distributed system with FastAPI, asynchronous workers, Redis, and Next.js requires checking multiple terminals and service logs, making it difficult to correlate events.
Результат
Implemented a centralized, real-time log viewer that aggregates structured logs from backend and workers via Redis Streams and SSE, improving debugging efficiency and operational visibility.
Рабочий процесс
- FastAPI backend and workers write structured Python log events to the Redis Stream 'reelquick:system:logs'.
- Each event includes timestamp, severity, service, source, message, and context (e.g., video/job ID).
- The Next.js server proxies protected FastAPI log endpoints to the browser, keeping Redis credentials server-side.
- The frontend loads recent history from Redis Streams and maintains live updates via Server-Sent Events (SSE).
- Users filter logs by severity (debug, info, warning, error, critical) and service (backend, workers).
- Users expand exception details to inspect failure contexts.
Доказательства
Reel Quick now writes structured Python log events to the Redis Stream reelquick:system:logs.
The Next.js server proxies the protected FastAPI log endpoints, which means the browser never receives Redis credentials or the logging API key.
- Дата записи: 2026-09-08T08:32:58.476Z