Skip to content

Commit 009f94c

Browse files
committed
fix(logs): SDK-Logger sets sdk-name and sdk-version attributes
1 parent e6a9743 commit 009f94c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Sentry/Internal/DefaultSentryStructuredLogger.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ private protected override void CaptureLog(SentryLogLevel level, string template
6969
}
7070

7171
var scope = _hub.GetScope();
72-
log.SetDefaultAttributes(_options, scope, scope?.Sdk ?? SdkVersion.Instance);
72+
var sdk = scope?.Sdk;
73+
if (sdk is null || (sdk.Name is null && sdk.Version is null))
74+
{
75+
sdk = SdkVersion.Instance;
76+
}
77+
log.SetDefaultAttributes(_options, scope, sdk);
7378

7479
CaptureLog(log);
7580
}

0 commit comments

Comments
 (0)