From 898f2cf2e93e0932937a2a44120ee84f20fdb731 Mon Sep 17 00:00:00 2001 From: ChuckNorrison <2964146+ChuckNorrison@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:29:49 +0200 Subject: [PATCH 1/3] Stop log spam for missing tor_web_addr In case tor is not used, we can not find a tor_web_addr key in redis db. This will prevent from spamming the journal. --- app/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils.py b/app/utils.py index 2ae63d0..5c2f36c 100644 --- a/app/utils.py +++ b/app/utils.py @@ -58,7 +58,8 @@ async def redis_get(key: str) -> str: v = await redis_plugin.redis.get(key) if not v: - logging.warning(f"Key '{key}' not found in Redis DB.") + if not "tor_web_addr" in key: + logging.warning(f"Key '{key}' not found in Redis DB.") return "" return v.decode("utf-8") From e27b52b236af422cb5e0b5e82bdc26575b35d325 Mon Sep 17 00:00:00 2001 From: ChuckNorrison <2964146+ChuckNorrison@users.noreply.github.com> Date: Mon, 10 Oct 2022 23:00:23 +0200 Subject: [PATCH 2/3] log Redis DB missing Keys as Info --- app/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/utils.py b/app/utils.py index 5c2f36c..19fc8ea 100644 --- a/app/utils.py +++ b/app/utils.py @@ -58,8 +58,7 @@ async def redis_get(key: str) -> str: v = await redis_plugin.redis.get(key) if not v: - if not "tor_web_addr" in key: - logging.warning(f"Key '{key}' not found in Redis DB.") + logging.info(f"Key '{key}' not found in Redis DB.") return "" return v.decode("utf-8") From ee7b48ed66746919eddb92a60433452b64bdf63c Mon Sep 17 00:00:00 2001 From: ChuckNorrison <2964146+ChuckNorrison@users.noreply.github.com> Date: Mon, 10 Oct 2022 23:10:36 +0200 Subject: [PATCH 3/3] log level Redis DB only tor as info --- app/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/utils.py b/app/utils.py index 19fc8ea..102de62 100644 --- a/app/utils.py +++ b/app/utils.py @@ -58,7 +58,11 @@ async def redis_get(key: str) -> str: v = await redis_plugin.redis.get(key) if not v: - logging.info(f"Key '{key}' not found in Redis DB.") + logstr = f"Key '{key}' not found in Redis DB." + if "tor_web_addr" in key: + logging.info(logstr) + else: + logging.warning(logstr) return "" return v.decode("utf-8")