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

Exceptions with properties that throw an exception when fetched fail to log #106

Merged

Conversation

samcook
Copy link
Contributor

@samcook samcook commented Sep 17, 2019

Hi,

We've come across an issue with the ElasticSearch target where, if we attempt to log an entry with an exception attached, and that exception has a property that can't be fetched due to throwing an exception, that causes the log message (or in fact an entire batch of log messages, if buffering is involved) to be lost.

This PR contains a change that means that properties causing errors while serializing are skipped instead of throwing an exception, and instead a warning is logged to the NLog internal log. It also avoids doing exception serialization at all if there is a custom field configured for exceptions.

…ptions that can't be serialised due to a property throwing an exception when fetched.
… blowing up and log a warning in the internal log instead.
@markmcdowell markmcdowell merged commit 1e98726 into markmcdowell:master Sep 17, 2019
@samcook samcook deleted the log-exception-with-props-that-throw branch September 18, 2019 10:45
@samcook
Copy link
Contributor Author

samcook commented Sep 19, 2019

Thanks for merging this in. Are there plans to release a new package soon?

@markmcdowell
Copy link
Owner

Yeah I've published a new version, the build server seems to have picked 7.0.10 instead of 7.0.1 though...

@markmcdowell
Copy link
Owner

I've deployed a new version as 7.1.0

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