Skip to content

Commit 86945c4

Browse files
authored
♻️Storage: Reduce noisy loggers impact (#4705)
1 parent 4bf6e90 commit 86945c4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

services/storage/src/simcore_service_storage/application.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
str
2626
] = '%a %t "%r" %s %b [%Dus] "%{Referer}i" "%{User-Agent}i"'
2727

28+
_LOG_LEVEL_STEP = logging.CRITICAL - logging.ERROR
29+
_NOISY_LOGGERS = (
30+
"aiobotocore",
31+
"aio_pika",
32+
"aiormq",
33+
"botocore",
34+
"sqlalchemy",
35+
)
2836
_logger = logging.getLogger(__name__)
2937

3038

@@ -68,6 +76,13 @@ def create(settings: Settings) -> web.Application:
6876
if settings.STORAGE_MONITORING_ENABLED:
6977
setup_monitoring(app, app_name, version=f"{version}")
7078

79+
# keep mostly quiet noisy loggers
80+
quiet_level: int = max(
81+
min(logging.root.level + _LOG_LEVEL_STEP, logging.CRITICAL), logging.WARNING
82+
)
83+
for name in _NOISY_LOGGERS:
84+
logging.getLogger(name).setLevel(quiet_level)
85+
7186
return app
7287

7388

0 commit comments

Comments
 (0)