Logging Module
The Logging module provides structured JSON logs, automatic request-response duration tracing, and an in-memory ring buffer that feeds live server console output directly to the admin dashboard.
Setup & Basic Usage
Register the LoggingModule with the Vorte application. In development, it prints logs in a human-readable format; in production, it switches automatically to structured JSON strings.
Logging in Controllers
Import and use the shared logger to write context-aware messages inside your API route handlers.
Dashboard Live Console & Ring Buffer
The Logging module maintains an in-memory log buffer via the RingBufferHandler. It intercepts logs produced by the root logger as well as third-party packages, specifically capturing logs from uvicorn, fastapi, and vorte namespace libraries:
- Ring Buffer Capacity: Holds up to the last 1000 logs in memory by default.
- Log Interception: Even if the
LoggingModuleisn't registered, theDashboardModulewill lazily attach theRingBufferHandlerto Named Python Loggers so logs are still captured. - Log Format: Log entries are retained with fields for `timestamp`, `level`, `message`, `logger` name, and `module` name for clean rendering in the logs terminal.