-
Notifications
You must be signed in to change notification settings - Fork 26
Feature request: Add DateOnly Converter to Logging JsonSerializer #501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hi @BradKnowles , this is a .Net 6 limitation This is an issue that will be present in other utilities like Tracing, due to the way XRay SDK does serialization. aws/aws-xray-sdk-dotnet#212 We will discuss this internally to see if there is anything we can do to improve the experience. At the moment the solution is to create the converters. |
cc: @amirkaws |
I was thinking it could be added like the |
@BradKnowles we will be adding custom converter for DateOnly and TmeOnly. Thanks for raising the issue. We will be updating this issue with the progress. |
@BradKnowles released in version 1.8.1 - Logging version 1.3.3. |
Use case
If the object being logged has a
DateOnly
property the Logging framework throws an exception.Serialization and deserialization of 'System.DateOnly' instances are not supported. The unsupported member type is located on type 'System.Nullable``1[System.DateOnly]'
Solution/User Experience
Ideally, the Logging framework would handle
DateOnly
fields without any additional or custom logic from application developers.Alternative solutions
At the moment, the workaround is to add a
[JsonConverter(typeof(DateOnlyJsonConverter))]
attribute to each property of the object being serialized, whereDateOnlyConverter
is a custom converter that is each of our applications.Acknowledgment
The text was updated successfully, but these errors were encountered: