We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5da81d5 commit 8992f7cCopy full SHA for 8992f7c
sentry_sdk/integrations/logging.py
@@ -357,11 +357,9 @@ def _capture_log_from_record(client, record):
357
# type: (BaseClient, LogRecord) -> None
358
scope = sentry_sdk.get_current_scope()
359
otel_severity_number, otel_severity_text = _python_level_to_otel(record.levelno)
360
- attrs = {
361
- "sentry.message.template": (
362
- record.msg if isinstance(record.msg, str) else repr(record.msg)
363
- ),
364
- } # type: dict[str, str | bool | float | int]
+ attrs = {} # type: dict[str, str | bool | float | int]
+ if isinstance(record.msg, str):
+ attrs["sentry.message.template"] = record.msg
365
if record.args is not None:
366
if isinstance(record.args, tuple):
367
for i, arg in enumerate(record.args):
0 commit comments