Skip to content

Config inner sdk logger#5260

Closed
vivek378521 wants to merge 3 commits into
open-telemetry:mainfrom
vivek378521:config-inner-sdk-logger
Closed

Config inner sdk logger#5260
vivek378521 wants to merge 3 commits into
open-telemetry:mainfrom
vivek378521:config-inner-sdk-logger

Conversation

@vivek378521
Copy link
Copy Markdown
Contributor

Description

Add a way to configure the InstrumentationScope used by the SDK logger created internally by LoggingHandler.

LoggingHandler previously always created its inner logger with __name__, an empty version, and an empty schema URL. This change allows callers to provide an explicit instrumentation scope while preserving compatibility with existing logger providers.

Fixes #4060

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Added unit coverage for LoggerProvider.get_logger with an explicit instrumentation scope.
  • Added unit coverage for LoggingHandler to verify exported LogData uses the provided instrumentation scope.
  • Added API proxy compatibility coverage for old-style logger providers that do not accept the new argument.

Reproduced with:

.tox/py312-test-opentelemetry-api/bin/pytest opentelemetry-api/tests/logs/test_proxy.py -q
.tox/py312-test-opentelemetry-sdk/bin/pytest opentelemetry-sdk/tests/logs/test_logs.py opentelemetry-sdk/tests/logs/test_export.py -q
git diff --check

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@vivek378521 vivek378521 requested a review from a team as a code owner May 31, 2026 06:33
@vivek378521 vivek378521 marked this pull request as draft May 31, 2026 06:35
@vivek378521 vivek378521 deleted the config-inner-sdk-logger branch May 31, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow configuration of inner SDK Logger using LoggingHandler

1 participant