api.log

Structured logs (JSON, or readable with LOG_FORMAT=console) to stdout and to a rotating file, for the API and the worker, plus one log line per HTTP request.

Functions

setup_logging() → None

Safe to call twice: the API process also imports the worker's Celery app.

logging_middleware(request, call_next)

global_exception_handler(request, exc)

Module Contents

api.log.setup_logging() → None

Safe to call twice: the API process also imports the worker’s Celery app.

async api.log.logging_middleware(request: fastapi.Request, call_next)
async api.log.global_exception_handler(request: fastapi.Request, exc: Exception)