'NLog: Remove logging rule by name if it was added without name by LoggingConfiguration.AddRule()?
I am new to NLog, but I think I have got a good understand of how it works in the last hours.
After digging deeper into NLog API, several questions about Logging Rules come up. One of them is:
How can I remove a rule by name (using LoggingConfiguration.RemoveRuleByName()) that I have added programmatically by LoggingConfiguration.AddRule() before?
LoggingConfiguration.AddRule()does not provide an argument to set theLoggingRule.RuleName.LoggingConfiguration.AddRule()does not take aLoggingRuleobject.- I don't want to check every rule in the
LoggingConfiguration.LoggingRulescollection, because this would mean checking them by content, because I cannot set a name.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
