private static void SetupTracing() { try { Trace.AddTraceSource(new TraceSource("AppTraceSource")); var appConfigWatcher = new ConfigTraceSwitchWatcher(); appConfigWatcher.Changed += ConfigTraceSwitchWatcherChanged; Trace.UpdateConfigurationAttributes(); } catch (Exception ex) { throw new Exception("Error raised while trying to update the traceSources by their config file settings", ex); } }
private static void SetupTracing(bool WatchAppConfigFileForChanges) { try { Trace.AddTraceSource(new TraceSource("AppTraceSource")); if (WatchAppConfigFileForChanges) { ConfigTraceSwitchWatcher AppConfigWatcher = new ConfigTraceSwitchWatcher(); AppConfigWatcher.Changed += new ConfigTraceSwitchWatcher.FileChangedHandler(ConfigTraceSwitchWatcher_Changed); } Trace.UpdateConfigurationAttributes(); } catch (Exception ex) { throw new Exception("Error raised while trying to update the traceSources by their config file settings", ex); } }