Conversation
This commit adds support for configuring FinalLevelMin through (environmental) variables. Resolves #NLog#5172.
|
Thanks for opening this pull request! |
|
Thank you for the unit-tests, that is a great step. Think the unit-test should also show that updating the NLog-Config-Variable and calling |
|
Okay, so just to be clear: I add a new property to In my first try, I implemented a new |
|
Maybe it is better to create a new method that takes inspiration from how Levels + Minlevel + MaxLevel from Layout is handled (without touching the existing logic for Minlevel + Max Level)
I trust what feels natural for you will be a good first direction.
|
|
What do you think of something like this? Also, the unit test <logger name='RequestLogger' minLevel='Debug' finalMinLevel='Error' writeTo='requestTarget' />Shouldn't the following log be ignored, since it is below requestLogger.Debug("Debug Noise");I will add more tests if you agree with this approach. |
|
Like the direction where LoggingRule FinalMinLevel-property now is implemented using Think you should merge
Lets say you have an application that depends on a special sub-module, and you want to have a dedicated log-target for that sub-module, but at the same time you would like all errors to flow to the catch-all log-target (but not info/warn): <logger name='RequestLogger' minLevel='Debug' writeTo='requestTarget' finalMinLevel='Error' />
<logger name='*' minLevel='Info' writeTo='catchAllTarget' /> |
|
Kudos, SonarCloud Quality Gate passed! |
|
Sorry about the many small commits to your pull-request-branch. But it now looks like the pull-request is making Will squash the commits, and starting working on getting NLog v5.1.3 released. Thanks for the unit-tests and pushing for getting this included. |
|
Hooray your first pull request is merged! Thanks for the contribution! Looking for more? 👼 Please check the up-for-grabs issues - thanks! |
|
Sorry for the late reply, last days were busy. Thanks @snakefoot! |
I tried to keep refactorings to a minimum and stay consistent with the rest of the code. Let me know if more changes are required. Resolves #5172