Skip to content

Commit 302d03d

Browse files
committed
remove noisy loggers, and also reduce amount of logs
1 parent 61f351d commit 302d03d

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/catalog/services.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
""" RPC client-side for the RPC server at the payments service
2-
3-
"""
1+
"""RPC client-side for the RPC server at the payments service"""
42

53
import logging
64
from typing import Any, cast
@@ -25,7 +23,6 @@
2523
_logger = logging.getLogger(__name__)
2624

2725

28-
@log_decorator(_logger, level=logging.DEBUG)
2926
async def list_services_paginated( # pylint: disable=too-many-arguments
3027
rpc_client: RabbitMQRPCClient,
3128
*,

services/catalog/src/simcore_service_catalog/api/rpc/_services.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ async def _wrapper(app: FastAPI, **kwargs):
5252

5353

5454
@router.expose(reraise_if_error_type=(CatalogForbiddenError,))
55-
@log_decorator(_logger, level=logging.DEBUG)
5655
@_profile_rpc_call
5756
async def list_services_paginated(
5857
app: FastAPI,

services/catalog/src/simcore_service_catalog/core/application.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,25 @@
2323

2424
_logger = logging.getLogger(__name__)
2525

26+
_LOG_LEVEL_STEP = logging.CRITICAL - logging.ERROR
27+
_NOISY_LOGGERS = (
28+
"aio_pika",
29+
"aiobotocore",
30+
"aiormq",
31+
"botocore",
32+
"httpcore",
33+
"werkzeug",
34+
)
35+
2636

2737
def create_app(settings: ApplicationSettings | None = None) -> FastAPI:
38+
# keep mostly quiet noisy loggers
39+
quiet_level: int = max(
40+
min(logging.root.level + _LOG_LEVEL_STEP, logging.CRITICAL), logging.WARNING
41+
)
42+
for name in _NOISY_LOGGERS:
43+
logging.getLogger(name).setLevel(quiet_level)
44+
2845
if settings is None:
2946
settings = ApplicationSettings.create_from_envs()
3047

0 commit comments

Comments
 (0)