@@ -593,14 +593,13 @@ class SentryAppenderTest {
593593 }
594594
595595 @Test
596- fun `sets contextTags from ThreadContext as attributes on logs` () {
596+ fun `sets properties from ThreadContext as attributes on logs` () {
597597 val logger =
598- fixture.getSut(minimumLevel = Level .INFO , contextTags = listOf (" traceId " , " spanId " ))
598+ fixture.getSut(minimumLevel = Level .INFO , contextTags = listOf (" someTag " ))
599599 ScopesAdapter .getInstance().options.logs.isEnabled = true
600600
601- ThreadContext .put(" traceId" , " trace-123" )
602- ThreadContext .put(" spanId" , " span-456" )
603- ThreadContext .put(" otherTag" , " otherValue" ) // Should not be included in attributes
601+ ThreadContext .put(" someTag" , " someValue" )
602+ ThreadContext .put(" otherTag" , " otherValue" )
604603 logger.info(" testing context tags in logs" )
605604
606605 Sentry .flush(1000 )
@@ -611,10 +610,8 @@ class SentryAppenderTest {
611610 val log = logs.items.first()
612611 assertEquals(" testing context tags in logs" , log.body)
613612 val attributes = log.attributes!!
614- assertEquals(" trace-123" , attributes[" traceId" ]?.value)
615- assertEquals(" span-456" , attributes[" spanId" ]?.value)
616- assertNull(attributes[" otherTag" ]) // Should not be included as it's not in contextTags
617- assertEquals(" auto.log.log4j2" , attributes[" sentry.origin" ]?.value)
613+ assertEquals(" someValue" , attributes[" someTag" ]?.value)
614+ assertEquals(" otherValue" , attributes[" otherTag" ]?.value)
618615 }
619616 )
620617 }
0 commit comments