Update authentication pymongo logger level

This commit is contained in:
jetli 2024-12-26 04:09:13 +00:00
parent f8b60391b2
commit 1972a5758b
2 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ async def initiate_database():
serverSelectionTimeoutMS=60000, serverSelectionTimeoutMS=60000,
minPoolSize=5, # Minimum number of connections in the pool minPoolSize=5, # Minimum number of connections in the pool
maxPoolSize=20, # Maximum 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( await init_beanie(
database=client[app_settings.MONGODB_NAME], document_models=backend_models database=client[app_settings.MONGODB_NAME], document_models=backend_models

View File

@ -32,6 +32,9 @@ def register(app=None):
logger.disable("pika.spec") logger.disable("pika.spec")
logger.disable("aiormq.connection") logger.disable("aiormq.connection")
logger.disable("urllib3.connectionpool") logger.disable("urllib3.connectionpool")
logging.getLogger("pymongo").setLevel(
logging.WARNING
) # Suppress pymongo DEBUG logs
class InterceptHandler(logging.Handler): class InterceptHandler(logging.Handler):