elastic / ecs-dotnet

https://www.elastic.co/guide/en/ecs-logging/dotnet/current/setup.html
Apache License 2.0
114 stars 58 forks source link

[BUG] Elastic.CommonSchema.NLog : `trace.id` field contains extra `}` #347

Closed MathieuJouis closed 5 months ago

MathieuJouis commented 9 months ago

ECS integration/library project(s): Elastic.CommonSchema.NLog 8.6.1

ECS schema version : 8.6.0

.NET framework / OS: .NET 7.0

Description of the problem, including expected versus actual behavior:

The produced field trace.id contains an extra } :

e.g. : "trace.id": "0HMV9PNIEVF7F:00000009}"

{
    "@timestamp": "2023-11-20T14:38:10.248235+01:00",
    "log.level": "Info",
    "message": "Message log",
    "ecs.version": "8.6.0",
    "log": {
        "logger": "My.Logger",
        "origin.file.name": "",
        "origin.function": ""
    },
    "span.id": "4c1ae36601f62ccc",
    "trace.id": "0HMV9PNIEVF7F:00000009}"
}

Responsible line : https://github.com/elastic/ecs-dotnet/blob/88f2bc81a0b7440e4059e323e610bb03df61862c/src/Elastic.CommonSchema.NLog/EcsLayout.cs#L104

Mpdreamz commented 5 months ago

Thank you for reporting this, and apologies for us taking a while to address this.

This should now be fixed as per https://github.com/elastic/ecs-dotnet/pull/348 and a new release will go out shortly.