private void RefreshAgentSettings(object state) { try { if (File.Exists(SettingsFilePath)) { var settingsText = File.ReadAllText(SettingsFilePath); var samplingSetting = SettingsManager.ParseSamplingSettings(settingsText, _appIdentifier); if (samplingSetting != null) { _samplingManager.SetSamplingPolicy(samplingSetting.Policy, samplingSetting.Overrides); } else { RaygunLogger.Instance.Warning($"Could not locate sampling settings for site {_appIdentifier}"); } } else { RaygunLogger.Instance.Warning($"Could not locate Raygun APM configuration file {SettingsFilePath}"); } } catch (Exception ex) { RaygunLogger.Instance.Error($"Error refreshing agent settings: {ex.Message}"); } }
private void RefreshAgentSettings(object state) { try { if (File.Exists(SettingsFilePath)) { var settingsText = File.ReadAllText(SettingsFilePath); var samplingSetting = SettingsManager.ParseSamplingSettings(settingsText, _appIdentifier); if (samplingSetting != null) { _samplingManager.SetSamplingPolicy(samplingSetting.Policy, samplingSetting.Overrides); } else { System.Diagnostics.Debug.WriteLine($"Could not locate sampling settings for site {_appIdentifier}"); } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine($"Error refreshing agent settings: {ex.Message}"); } }