Skip to content

logging_config

logging_config

Centralized logging configuration for Alkiviades.

setup_logging

setup_logging(
    log_file: str | None = None, level: int = INFO
) -> None

Configure root logger with console and optional rotating file handler.

Parameters:

Name Type Description Default
log_file str | None

Path to log file. If None, only console logging is used.

None
level int

Logging level (default INFO).

INFO

In production (Render), structured JSON lines are logged to stdout. In development, a rotating file handler keeps up to 3 files × 10 MB.

tail_log

tail_log(log_file: str, lines: int = 100) -> str

Return the last N lines of the log file.