Enhance logging system with file rotation and unified configuration

• Unify logging across Gunicorn and Uvicorn
• Add rotating file handlers
This commit is contained in:
yangdx
2025-02-28 14:57:25 +08:00
parent 8cd45161f2
commit 157ec862ae
5 changed files with 166 additions and 44 deletions

View File

@@ -157,6 +157,10 @@ def main():
value = getattr(self.config_module, key)
if callable(value):
self.cfg.set(key, value)
# 确保正确加载 logconfig_dict
if hasattr(self.config_module, 'logconfig_dict'):
self.cfg.set('logconfig_dict', getattr(self.config_module, 'logconfig_dict'))
# Override with command line arguments if provided
if gunicorn_args.workers: