-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Description
Hi, we are planning to use Elastic.CommonSchema.NLog package in our C# Lambda which is performing logging using NLog already. The code package is produced with AOT compilation and we are using source generation for System.Text.Json for maximum AOT compatibility.
When I plugged EcsLayout into my console logs I started getting these errors.
JsonTypeInfo metadata for type 'System.DateTimeOffset' was not provided by TypeInfoResolver of type '<null>'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.
With stack traces like this:
at System.Text.Json.ThrowHelper.ThrowNotSupportedException_NoMetadataForType(Type type, IJsonTypeInfoResolver resolver)
at System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type type, Boolean ensureConfigured, Nullable`1 ensureNotNull, Boolean resolveIfMutable, Boolean fallBackToNearestAncestorType)
at System.Text.Json.JsonSerializerOptions.GetConverterInternal(Type typeToConvert)
at Elastic.CommonSchema.Serialization.EcsJsonConfiguration..cctor() in C:\stash\ecs-dotnet\src\Elastic.CommonSchema\Serialization\JsonConfiguration.cs:line 39
I have a couple of questions.
- Is there some configuration currently I can perform to make this work?
- If not, could this be made to work in Elastic.CommonSchema.NLog?
I've pulled the ecs-dotnet repo and made local changes directly. I could get it to work with my use case with the following changes.
However I don't understand enough of how everything hangs together to know if this will work for all use-cases.
Appreciate your assistance.
Metadata
Metadata
Assignees
Labels
No labels