Refactor logging setup to use Loguru in WSGI and views for improved logging consistency and debugging
This commit is contained in:
@@ -13,6 +13,7 @@ from django.core.wsgi import get_wsgi_application
|
||||
from loguru import logger
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import logging
|
||||
|
||||
# Configure Loguru sinks early so app imports see consistent logging.
|
||||
# Log to stdout (so `docker logs` shows messages) and to a file at
|
||||
@@ -35,6 +36,8 @@ try:
|
||||
serialize=True,
|
||||
)
|
||||
logger.debug("Loguru logging configured with stdout and file sinks")
|
||||
|
||||
logging.root.setLevel(logging.DEBUG)
|
||||
except Exception:
|
||||
# Best-effort only — don't crash WSGI startup if logging can't be configured
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user