Skip to content

Commit b77aaa6

Browse files
Suppress third party loggers
1 parent 7d772e3 commit b77aaa6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • backend/src/acidwatch_api

backend/src/acidwatch_api/app.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@
2525
level=logging.INFO,
2626
)
2727

28+
# These SDKs log routine request/response and transmission chatter at INFO,
29+
# which is noisy in production. Keep root at INFO for app/uvicorn logs, but
30+
# quiet these specific third-party loggers down to WARNING.
31+
_NOISY_LOGGERS = [
32+
"azure.core.pipeline.policies.http_logging_policy",
33+
"azure.monitor.opentelemetry.exporter",
34+
"azure.identity",
35+
"httpx",
36+
"httpcore",
37+
]
38+
for _logger_name in _NOISY_LOGGERS:
39+
logging.getLogger(_logger_name).setLevel(logging.WARNING)
40+
2841

2942
tracer = trace.get_tracer(__name__, tracer_provider=get_tracer_provider())
3043

0 commit comments

Comments
 (0)