i am trying to edit the logging level in the config file programmaticly.
foreach (var rule in LogManager.Configuration.LoggingRules)
{
if (m_loginglevelcomboBox.SelectedItem.ToString() == "Debug")
{
rule.EnableLoggingForLevel(LogLevel.Debug);
}
else
{
rule.EnableLoggingForLevel(LogLevel.Info);
}
}
//LogManager.ReconfigExistingLoggers();
I am not interested in calling the Reconfig,as the changes will affect the application on the fly. I want the changes to be made when the application is restarted. so I need it to edit the config file.
i cant use xDocument ,as linq is not compatible with my .net version so how can i edit the minlevel rule to debug/info ?