Hi we have a category filter in our configuration file to turn on/off tracing. In production, we want turning tracing on and off to be done via a button - not manually editing the configuration file.
This is the XML in the config file
<categoryFilters><add name = "PostSharpTrace"/></categoryFilters>
This is the C# code I have thus far to open the configuration file, I thought the logging section was read only so we could do this?
CategoryFilter cfCategoryFilter = Logger. GetFilter<CategoryFilter>();
ExeConfigurationFileMap filemap = new ExceConfigurationFileMap()
filemap.ExeConfigFilename = Application.StartupPath +"\\" + EnterpriseLibraryClient.config":
Configuration entlibConfig = ConfigurationManager. OpenMappedExeConfiguration(filemap, ConfigurationuserLevel.None);
// Modify the value in the configuration file
if (TurnTracingOn == true)
// how do I Add the value to the category?
// how do I remove the value to the category?