Closed ifoutz closed 1 year ago
Thanks for reporting this one @ifoutz ! It's a bit of a catch22 situation so I am still working out how to break out of this self referencing loop.
The cause is that Elastic.Apm itself logs in the property getter for ServiceVersion if that is not configured explicitly:
cc @gregkalapos
Opened a fix for this in the agent: https://github.com/elastic/apm-agent-dotnet/pull/2054
This will mean we need to bump the minimum version in our ECS.NET packages too once the fix is released.
ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog):
Elastic.Apm.SerilogEnricher
ECS schema version (e.g. 1.4.0):
8.4.0
ECS .NET assembly version (e.g. 1.4.2):
8.4.0-alpha4
Elasticsearch version (if applicable):
.NET framework / OS:
.Net 6, Windows 10
Description of the problem, including expected versus actual behavior:
I am using Serilog and ECS to log a simple web api application. Here is the logging setup:
If I comment out the line:
.Enrich.WithElasticApmCorrelationInfo()
then it works as expected. But when that line is left in, I get a StackOverflowException before the app finishes initializing. Here is the stack trace I get:Steps to reproduce: