I am trying to block some not needed Microsoft debug logs in my app. I have a separate settings file where nLogLevel is set as either info or debug depending what my settings say. When nLogLevel is set as info everything works as intended. But when it is set as debug, those Microsoft debug logs are being logged, even though I say here that minlevel should be always info.
// Rules for mapping loggers to targets.
loggingConfiguration.AddRule(nLogLevel, LogLevel.Fatal, logDb);
loggingConfiguration.AddRule(nLogLevel, LogLevel.Fatal, logfile);
loggingConfiguration.AddRule(LogLevel.Info, LogLevel.Fatal, logDb, "Microsoft.*");
loggingConfiguration.AddRule(LogLevel.Info, LogLevel.Fatal, logfile, "Microsoft.*");
Am I missing something really obvious here or should I do ruling differently?
NLog version numbers are
- NLog.Database=”5.2.8″
- NLog.Extensions.Logging=”5.3.8″