Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Adding property with dot in name doesn't work #354

Closed
Belorus opened this issue Aug 18, 2020 · 1 comment
Closed

Adding property with dot in name doesn't work #354

Belorus opened this issue Aug 18, 2020 · 1 comment

Comments

@Belorus
Copy link

Belorus commented Aug 18, 2020

if (Agent.IsConfigured && Agent.Tracer?.CurrentTransaction != null)
            {
                logEvent.AddOrUpdateProperty(propertyFactory.CreateProperty("transaction.id", Agent.Tracer.CurrentTransaction.Id ));
                logEvent.AddOrUpdateProperty(propertyFactory.CreateProperty("trace.id", Agent.Tracer.CurrentTransaction.TraceId ));
            }

Dots in field names are escaped, and therefore it's impossible to send trace.id field to employ APM log correlation without writing custom JSON Serializer. It is written as trace/id

https://github.com/serilog/serilog-sinks-elasticsearch/blob/dev/src/Serilog.Formatting.Elasticsearch/ElasticsearchJsonFormatter.cs#L154

@mivano
Copy link
Contributor

mivano commented Sep 16, 2020

I just merged PR #351 into dev. That should address this issue.

@mivano mivano closed this as completed Sep 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants