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

Bugfix: Broken xml stops logging #671

Merged
10 commits merged into from
May 10, 2015
Merged

Bugfix: Broken xml stops logging #671

10 commits merged into from
May 10, 2015

Conversation

304NotModified
Copy link
Member

fixes #273

problem: XmlLoggingConfiguration.Initialize eats exception with invalid
XML. ALso XmlLoggingConfiguration.Reload never returns null.
So the null check is not enough

  • added InitializeSucceeded (nullable bool) in XmlLoggingConfiguration
  • checks also InitializeSucceeded. Iffalse, DON't apply the config.

Result: invalidating the XML won't stop logging, the old config will be used.
Also, the auto reload won't turned to false (the default)

The unit tests proves the solution and also the previous problem.

- Auto_reload_validxml_test succeeds
- Auto_Reload_invalidxml_test fails
problem: XmlLoggingConfiguration.Initialize eats exception with invalid
XML. ALso XmlLoggingConfiguration.Reload never returns null.
So the null check is not enough

- added InitializeSucceeded in XmlLoggingConfiguration
- checks also InitializeSucceeded. If false, DON't apply the config.

Result: invalidation XML wont stop logging, the old config will be used.
Also, the auto reload won't turned to false (the default)
@304NotModified 304NotModified added the bug Bug report / Bug fix label Apr 17, 2015
@304NotModified 304NotModified added this to the 4.0 milestone Apr 17, 2015
@304NotModified
Copy link
Member Author

The changes are small, but a review would be wise because there is a new public property added.

@304NotModified 304NotModified changed the title Broken xml stops logging Bugfix: Broken xml stops logging Apr 17, 2015
@ghost
Copy link

ghost commented Apr 24, 2015

Looks good to me. Just wondering about all the linebreaks between the tests? Any reason for this?

@304NotModified
Copy link
Member Author

The line breaks is just bad coding style of me ;) - I like white space when programming.

Most of the time I let Resharper fix this, but too bad the NLog code style if really different then my Resharper profile (I like var for example)

I will fix this code styling thing with a commit.

@304NotModified 304NotModified self-assigned this May 3, 2015
@304NotModified
Copy link
Member Author

wtf. Removed newlines and now are the unit tests failing?

@304NotModified
Copy link
Member Author

Unit tests are fixed and PR is ready for merge after review.

@304NotModified 304NotModified removed their assignment May 6, 2015
@@ -62,6 +62,8 @@ public class XmlLoggingConfiguration : LoggingConfiguration

private string originalFileName;


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you delete these extra newlines?

@ghost
Copy link

ghost commented May 10, 2015

@304NotModified Good work, please see my comments, otherwise it looks great

@304NotModified
Copy link
Member Author

Thanks.

Unneeded newlines removed!

ghost pushed a commit that referenced this pull request May 10, 2015
@ghost ghost merged commit b9d3fb0 into NLog:master May 10, 2015
@304NotModified 304NotModified deleted the broken-xml-stops-logging branch August 15, 2015 20:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report / Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant