diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py index b7e56eda38..37aeb7b92f 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py @@ -438,6 +438,7 @@ def force_flush(self, timeout_millis: int = 30000) -> bool: "exc_text", "filename", "funcName", + "getMessage", "message", "levelname", "levelno", @@ -547,10 +548,7 @@ def _translate(self, record: logging.LogRecord) -> LogRecord: if self.formatter: body = self.format(record) else: - if isinstance(record.msg, str) and record.args: - body = record.msg % record.args - else: - body = record.msg + body = record.getMessage() # related to https://github.com/open-telemetry/opentelemetry-python/issues/3548 # Severity Text = WARN as defined in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity.