diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py index e0439a3d278..6a4d2153f7f 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py @@ -311,10 +311,11 @@ class LoggingHandler(logging.Handler): def __init__( self, level=logging.NOTSET, - log_emitter=None, + log_emitter_provider=None, ) -> None: super().__init__(level=level) - self._log_emitter = log_emitter or get_log_emitter(__name__) + self._log_emitter_provider = log_emitter_provider or get_log_emitter_provider() + self._log_emitter = get_log_emitter(__name__, log_emitter_provider=self._log_emitter_provider) @staticmethod def _get_attributes(record: logging.LogRecord) -> Attributes: