Skip to content

Commit 868aae1

Browse files
committed
done
1 parent 01b68a3 commit 868aae1

File tree

1 file changed

+20
-0
lines changed
  • services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core

1 file changed

+20
-0
lines changed

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/application.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import logging
2+
13
from fastapi import FastAPI
24
from servicelib.fastapi.openapi import override_fastapi_openapi_method
35
from servicelib.fastapi.profiler_middleware import ProfilerMiddleware
@@ -26,10 +28,28 @@
2628
from ..services.status_monitor import setup_status_monitor
2729
from .settings import ApplicationSettings
2830

31+
LOG_LEVEL_STEP = logging.CRITICAL - logging.ERROR
32+
NOISY_LOGGERS = (
33+
"faststream",
34+
"faststream.access",
35+
"simcore_service_dynamic_scheduler.services.deferred_manager_common",
36+
)
37+
38+
_logger = logging.getLogger(__name__)
39+
2940

3041
def create_app(settings: ApplicationSettings | None = None) -> FastAPI:
3142
app_settings = settings or ApplicationSettings.create_from_envs()
3243

44+
# keep mostly quiet noisy loggers
45+
quiet_level: int = max(
46+
min(logging.root.level + LOG_LEVEL_STEP, logging.CRITICAL), logging.WARNING
47+
)
48+
for name in NOISY_LOGGERS:
49+
logging.getLogger(name).setLevel(quiet_level)
50+
51+
_logger.debug("App settings:\n%s", app_settings.json(indent=2))
52+
3353
app = FastAPI(
3454
title=f"{PROJECT_NAME} web API",
3555
description=SUMMARY,

0 commit comments

Comments
 (0)