Ativa o logger em arquivo na inicialização da API

Chama setup_logging() no main.py e faz o logger api_podium propagar pro root,
pra que as mensagens cheguem no arquivo em logs/. Adiciona saída no console
no QueueListener e o shutdown_logging() no lifespan do FastAPI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ricardo 2026-10-08 14:48:35 -03:00
parent ed597f8c61
commit b0a677a685
3 changed files with 15 additions and 9 deletions

View file

@ -136,7 +136,10 @@ def setup_logging():
if _queue_listener is not None:
_queue_listener.stop()
_queue_listener = QueueListener(log_queue, file_handler, respect_handler_level=True)
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
_queue_listener = QueueListener(log_queue, file_handler, console_handler, respect_handler_level=True)
_queue_listener.start()
# --- 6. LOGGER RAIZ ---