From 9afee87c6cbf56cf14debdc5a1b8de3e719136df Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 19 Mar 2024 22:55:51 +0100 Subject: [PATCH] Fix: Log level could not be configured from settings Solution: Add a `LOG_LEVEL` setting defaulting to "WARNING". --- src/aleph/vm/conf.py | 1 + src/aleph/vm/orchestrator/cli.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/aleph/vm/conf.py b/src/aleph/vm/conf.py index f2c11a989..3f27a58f2 100644 --- a/src/aleph/vm/conf.py +++ b/src/aleph/vm/conf.py @@ -139,6 +139,7 @@ class Settings(BaseSettings): # System logs make boot ~2x slower PRINT_SYSTEM_LOGS = False IGNORE_TRACEBACK_FROM_DIAGNOSTICS = True + LOG_LEVEL = "WARNING" DEBUG_ASYNCIO = False # Networking does not work inside Docker/Podman diff --git a/src/aleph/vm/orchestrator/cli.py b/src/aleph/vm/orchestrator/cli.py index 65b290ba2..adb817d74 100644 --- a/src/aleph/vm/orchestrator/cli.py +++ b/src/aleph/vm/orchestrator/cli.py @@ -294,10 +294,6 @@ def main(): if args.profile else "%(asctime)s | %(levelname)s | %(message)s" ) - logging.basicConfig( - level=args.loglevel, - format=log_format, - ) settings.update( USE_JAILER=args.use_jailer, @@ -307,6 +303,12 @@ def main(): FAKE_DATA_PROGRAM=args.fake_data_program, DEBUG_ASYNCIO=args.debug_asyncio, FAKE_INSTANCE_BASE=args.fake_instance_base, + LOG_LEVEL=logging.getLevelName(args.loglevel), + ) + + logging.basicConfig( + level=settings.loglevel, + format=log_format, ) if args.run_fake_instance: