Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

LoggingConfiguration - ValidateConfig should only throw when enabled - #4102

#4102
Merged
304NotModified merged 1 commit into
NLog:masterNLog/NLog:masterfrom
snakefoot:MissingRequiredParameterShouldNotThrowsnakefoot/NLog:MissingRequiredParameterShouldNotThrowCopy head branch name to clipboard
Aug 29, 2020
Merged

LoggingConfiguration - ValidateConfig should only throw when enabled#4102
304NotModified merged 1 commit into
NLog:masterNLog/NLog:masterfrom
snakefoot:MissingRequiredParameterShouldNotThrowsnakefoot/NLog:MissingRequiredParameterShouldNotThrowCopy head branch name to clipboard

Conversation

@snakefoot

@snakefoot snakefoot commented Aug 29, 2020

Copy link
Copy Markdown
Contributor

Trying to resolve #4099

For some reason then NLog has always thrown exceptions on missing / invalid required-parameters. Independent of throwException or throwConfigException.

I think NLog should continue even if having loaded invalid config (Logging should not break the host application).

Have adjusted the validation logic so it is expected that objects that implements ISupportsInitialize will implicit call CheckRequiredParameters. This ensures that Target-objects will become disabled and not call InitializeTarget (Just like now).

This has the side-effect that Layouts and LayoutRenderers will now also call CheckRequiredParameters when created and used outside the context of the LoggingConfiguration. Think this is an improvement.

@snakefoot snakefoot added the enhancement Improvement on existing feature label Aug 29, 2020
@snakefoot snakefoot added this to the 4.7.5 milestone Aug 29, 2020
@snakefoot
snakefoot force-pushed the MissingRequiredParameterShouldNotThrow branch 6 times, most recently from 40f8393 to 0ff1b5b Compare August 29, 2020 09:55
@snakefoot
snakefoot force-pushed the MissingRequiredParameterShouldNotThrow branch from 0ff1b5b to 94de02a Compare August 29, 2020 10:16
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Aug 29, 2020

@304NotModified 304NotModified left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Looks good!

@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

63.6% 63.6% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement on existing feature size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.