Enhance logging configuration in WSGI setup for better debugging and error handling
This commit is contained in:
+3
-1
@@ -34,12 +34,14 @@ try:
|
||||
enqueue=True,
|
||||
serialize=True,
|
||||
)
|
||||
logger.debug("Loguru logging configured with stdout and file sinks")
|
||||
except Exception:
|
||||
# Best-effort only — don't crash WSGI startup if logging can't be configured
|
||||
try:
|
||||
logger.add(sys.stderr)
|
||||
logger.add(sys.stderr, level="DEBUG", enqueue=True, backtrace=False, diagnose=False)
|
||||
except Exception:
|
||||
pass
|
||||
logger.debug("Failed to configure Loguru logging sinks, continuing without file logging")
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rad.settings")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user