From 1972a5758b5b7119a8d654a9d6ccafc2cb3c6127 Mon Sep 17 00:00:00 2001 From: Jet Li Date: Thu, 26 Dec 2024 04:09:13 +0000 Subject: [PATCH] Update authentication pymongo logger level --- apps/authentication/webapi/providers/database.py | 1 + apps/authentication/webapi/providers/logger.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/apps/authentication/webapi/providers/database.py b/apps/authentication/webapi/providers/database.py index 70d5246..3e2d2b1 100644 --- a/apps/authentication/webapi/providers/database.py +++ b/apps/authentication/webapi/providers/database.py @@ -19,6 +19,7 @@ async def initiate_database(): serverSelectionTimeoutMS=60000, minPoolSize=5, # Minimum number of connections in the pool maxPoolSize=20, # Maximum number of connections in the pool + heartbeatFrequencyMS=20000, # Adjust heartbeat frequency to 20 seconds ) await init_beanie( database=client[app_settings.MONGODB_NAME], document_models=backend_models diff --git a/apps/authentication/webapi/providers/logger.py b/apps/authentication/webapi/providers/logger.py index 9bc8adb..b9fd1b4 100644 --- a/apps/authentication/webapi/providers/logger.py +++ b/apps/authentication/webapi/providers/logger.py @@ -32,6 +32,9 @@ def register(app=None): logger.disable("pika.spec") logger.disable("aiormq.connection") logger.disable("urllib3.connectionpool") + logging.getLogger("pymongo").setLevel( + logging.WARNING + ) # Suppress pymongo DEBUG logs class InterceptHandler(logging.Handler):