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

Use Convert instead of cast for formatting ElapsedMilliseconds #345

Closed ixnas closed 5 months ago

ixnas commented 10 months ago

For a project I'm using SerilogWeb.Classic to log HTTP requests. The ECS formatter crashed when it tried to cast ElapsedMilliseconds from a message template, because SerilogWeb.Classic passed a long, while the ECS formatter expected a double.

Because the property is boxed, the formatter would crash when trying to cast a boxed long to a double.

I can't find any specification on the specific type that this property should have, so I figured the formatter should be agnostic about the exact numerical type.

Mpdreamz commented 5 months ago

run docs-build