File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
main/java/io/sentry/logger Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,10 @@ private void captureLog(
221221 final @ Nullable SentryId controllerReplayId =
222222 scopes .getOptions ().getReplayController ().getReplayId ();
223223 if (!controllerReplayId .equals (SentryId .EMPTY_ID )) {
224+ attributes .put (
225+ "sentry.replay_id" ,
226+ new SentryLogEventAttributeValue (
227+ SentryAttributeType .STRING , controllerReplayId .toString ()));
224228 attributes .put (
225229 "sentry._internal.replay_is_buffering" ,
226230 new SentryLogEventAttributeValue (SentryAttributeType .BOOLEAN , true ));
Original file line number Diff line number Diff line change @@ -2972,7 +2972,9 @@ class ScopesTest {
29722972 .captureLog(
29732973 check {
29742974 assertEquals(" log message" , it.body)
2975+ val logReplayId = it.attributes?.get(" sentry.replay_id" )
29752976 val logReplayType = it.attributes?.get(" sentry._internal.replay_is_buffering" )
2977+ assertNull(logReplayId)
29762978 assertNull(logReplayType)
29772979 },
29782980 anyOrNull(),
@@ -2991,7 +2993,9 @@ class ScopesTest {
29912993 .captureLog(
29922994 check {
29932995 assertEquals(" log message" , it.body)
2996+ val logReplayId = it.attributes?.get(" sentry.replay_id" )
29942997 val logReplayType = it.attributes?.get(" sentry._internal.replay_is_buffering" )
2998+ assertEquals(replayId.toString(), logReplayId!! .value)
29952999 assertNull(logReplayType)
29963000 },
29973001 anyOrNull(),
@@ -3016,7 +3020,9 @@ class ScopesTest {
30163020 .captureLog(
30173021 check {
30183022 assertEquals(" log message" , it.body)
3023+ val logReplayId = it.attributes?.get(" sentry.replay_id" )
30193024 val logReplayType = it.attributes?.get(" sentry._internal.replay_is_buffering" )!!
3025+ assertEquals(replayId.toString(), logReplayId!! .value)
30203026 assertTrue(logReplayType.value as Boolean )
30213027 },
30223028 anyOrNull(),
You can’t perform that action at this time.
0 commit comments