Skip to content
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

fix(NLog): revert to use NLog internal JsonSerializer #244

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

AndreaCuneo
Copy link
Contributor

The NLog internal json serializer do not support types that STJ does, thus seemed smart to use STJ. But STJ doesn't fallback to Convert.ToString() for unsupported types (e.g. Type).

Instead in Logging is common to expect the logging parameters by using ToString() / Convert.ToString() and by extension also when serializing the Structured Logging json.

Revert to Default Json serializer until a better option is devised, e.g. by agumenting the STJ to fallback to string for unsupported types.

@AndreaCuneo AndreaCuneo requested review from MarcoGix and a team as code owners October 3, 2024 14:01
The NLog internal json serializer do not support types that STJ does, thus seemed smart to use
STJ. But STJ doesn't fallback to Convert.ToString() for unsupported types (e.g. Type).

Instead in Logging is common to expect the logging parameters by using ToString() / Convert.ToString() and by extension also when serializing the Structured Logging json.

Revert to Default Json serializer until a better option is devised, e.g. by agumenting the STJ to fallback to string for unsupported types.
@AndreaCuneo AndreaCuneo force-pushed the bugfix/NLog_JsonSerializer_Error branch from 1103157 to 08ff569 Compare October 3, 2024 14:04
@AndreaCuneo AndreaCuneo merged commit 7fbe457 into master Oct 3, 2024
5 checks passed
@AndreaCuneo AndreaCuneo deleted the bugfix/NLog_JsonSerializer_Error branch October 3, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants