I find this cryptic and counter-intuitive:
Why does it work:
LoggingConfiguration config = LogManager.Configuration; config.LoggingRules.Add(rule); LogManager.Configuration = config;
Until this is (EDIT: log files will not be written to the target file):
LogManager.Configuration.LoggingRules.Add(rule);
It's funny to see how ready-to-use code snippets spread, while the detailed explanations are so scarce
source share