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

LogFactory - Avoid checking candidate NLog-config files for every Logger created #4824

Merged
merged 1 commit into from
Mar 6, 2022

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Mar 6, 2022

NLog should not introduce a performance-hit during application-startup when not able to load NLog.config (Or no NLog.config available). The performance-hit would depend on the number of unique Logger-objects that are created.

Before it would attempt to scan all NLog-config-candidate-file-locations for every unique Logger-object created by the application (until NLog-config has been loaded). Now it will only do an initial auto-scan on the first Logger-creation.

One could consider creating a fluent Setup()-extension-method that starts file-watchers for all candidate-locations, that stays active until a valid NLog-configuration is loaded. See also #1114

@sonarcloud
Copy link

sonarcloud bot commented Mar 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@snakefoot snakefoot merged commit d237c11 into NLog:dev Mar 6, 2022
@snakefoot snakefoot changed the title LogFactory - Avoid loading candidate NLog-config files for every Logger created LogFactory - Avoid checkng candidate NLog-config files for every Logger created Apr 26, 2022
@snakefoot snakefoot changed the title LogFactory - Avoid checkng candidate NLog-config files for every Logger created LogFactory - Avoid checking candidate NLog-config files for every Logger created May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant