Skip to content

Commit 59fcc58

Browse files
lucaspimentelclaude
andcommitted
Fix empty ddtags being added to logs
Changed the check to use !string.IsNullOrEmpty(Tags) instead of Tags is not null to prevent writing empty ddtags property to JSON logs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9f8fdf4 commit 59fcc58

File tree

1 file changed

+1
-1
lines changed
  • tracer/src/Datadog.Trace/Logging/DirectSubmission/Formatting

1 file changed

+1
-1
lines changed

tracer/src/Datadog.Trace/Logging/DirectSubmission/Formatting/LogFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ internal void FormatLog<T>(
349349

350350
EnrichTagsStringWithGitMetadata();
351351

352-
if (Tags is not null && !renderingDetails.HasRenderedTags)
352+
if (!string.IsNullOrEmpty(Tags) && !renderingDetails.HasRenderedTags)
353353
{
354354
writer.WritePropertyName(TagsPropertyName, escape: false);
355355
writer.WriteValue(Tags);

0 commit comments

Comments
 (0)