SIGN IN SIGN UP

feat(config): wire top-level log_level field in declarative configuration (#5351)

* feat(config): wire log_level field into configure_sdk

Map the top-level `log_level` field from declarative configuration to
the `opentelemetry` root logger level so SDK internal diagnostics
respect the configured severity.

* chore: add changelog entry for #5351

* Update opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_sdk.py

Co-authored-by: Mike Goldsmith <goldsmith.mike@gmail.com>

* fix(config): address review feedback on log_level wiring

Apply log_level before the disabled early-return so SDK self-diagnostics
respect the configured severity even when disabled=true, per spec (they
are independent sibling fields). Cover all SeverityNumber variants
(*2/*3, not just base and *4) in the mapping test, restore the original
opentelemetry logger level in test teardown instead of hardcoding
NOTSET, and correct the changelog wording from "root logger" to
"opentelemetry logger".

* fix(config): import logging levels and correct test patch paths

The log_level wiring referenced logging.DEBUG/getLogger while only
getLogger was imported, so the module raised NameError at import time
and every configuration test, lint, and typecheck job failed. Import
the level constants directly and repoint the new log_level tests from
the stale opentelemetry.sdk._configuration._sdk path to the current
opentelemetry.configuration._sdk module.

* Move log_level check after enabled check

* Align docstring and test with disabled-overrides-log_level behavior

---------

Co-authored-by: Mike Goldsmith <goldsmith.mike@gmail.com>
D
Diego Hurtado committed
ee21783549ed15234e3ac2682872f93c7371f249
Parent: 7f28090
Committed by GitHub <noreply@github.com> on 7/28/2026, 9:39:22 PM