From 0ee2e7fd4800050ef2d1819c157a196ed66cf4fa Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 7 Mar 2025 16:56:48 +0800 Subject: [PATCH] Suppress Neo4j warning logs by setting logger level. --- lightrag/kg/neo4j_impl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightrag/kg/neo4j_impl.py b/lightrag/kg/neo4j_impl.py index 2498341d..265c0347 100644 --- a/lightrag/kg/neo4j_impl.py +++ b/lightrag/kg/neo4j_impl.py @@ -15,6 +15,7 @@ from tenacity import ( retry_if_exception_type, ) +import logging from ..utils import logger from ..base import BaseGraphStorage from ..types import KnowledgeGraph, KnowledgeGraphNode, KnowledgeGraphEdge @@ -37,6 +38,8 @@ config.read("config.ini", "utf-8") # Get maximum number of graph nodes from environment variable, default is 1000 MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000)) +# Set neo4j logger level to ERROR to suppress warning logs +logging.getLogger("neo4j").setLevel(logging.ERROR) @final @dataclass