diff --git a/gunicorn_config.py b/gunicorn_config.py index fdb0140a..3139d21e 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -70,11 +70,6 @@ logconfig_dict = { 'level': 'INFO', 'propagate': False }, - 'uvicorn': { - 'handlers': ['console', 'file'], - 'level': 'INFO', - 'propagate': False - }, 'gunicorn': { 'handlers': ['console', 'file'], 'level': 'INFO', @@ -84,6 +79,11 @@ logconfig_dict = { 'handlers': ['console', 'file'], 'level': 'INFO', 'propagate': False + }, + 'gunicorn.access': { + 'handlers': ['console', 'file'], + 'level': 'INFO', + 'propagate': False } } } diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 66fcacde..33a03cbc 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -39,13 +39,10 @@ from .routers.query_routes import create_query_routes from .routers.graph_routes import create_graph_routes from .routers.ollama_api import OllamaAPI -from lightrag.utils import logger as utils_logger +from lightrag.utils import logger, set_verbose_debug # Load environment variables -try: - load_dotenv(override=True) -except Exception as e: - utils_logger.warning(f"Failed to load .env file: {e}") +load_dotenv(override=True) # Initialize config parser config = configparser.ConfigParser() @@ -88,10 +85,6 @@ class LightragPathFilter(logging.Filter): def create_app(args): - # Initialize verbose debug setting - # Can not use the logger at the top of this module when workers > 1 - from lightrag.utils import set_verbose_debug, logger - # Setup logging logger.setLevel(getattr(logging, args.log_level)) set_verbose_debug(args.verbose)