public static string GetAppSettingsValue(string keyName, LoggingLevels levelToLog) { s_configurationFileReader = s_configurationFileReader ?? ConfigurationFileReaderProvider.Service; string value = s_configurationFileReader.GetValue(keyName); if (string.IsNullOrEmpty(value)) { switch (levelToLog) { case LoggingLevels.Info: Log.Info("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.Trace: Log.Trace("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.Warning: Log.Warning("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.Error: Log.Error("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.None: break; } } return(value); }
public static string GetAppSettingsValue(string keyName, bool logNotFound) { s_configurationFileReader = s_configurationFileReader ?? ConfigurationFileReaderProvider.Service; string value = s_configurationFileReader.GetValue(keyName); if (logNotFound) { if (string.IsNullOrEmpty(value)) { Log.Error("Parameter {0} not found in appsettings", keyName); } } return value; }
public static string GetAppSettingsValue(string keyName, bool logNotFound) { s_configurationFileReader = s_configurationFileReader ?? ConfigurationFileReaderProvider.Service; string value = s_configurationFileReader.GetValue(keyName); if (logNotFound) { if (string.IsNullOrEmpty(value)) { Log.Error("Parameter {0} not found in appsettings", keyName); } } return(value); }
public static string GetAppSettingsValue(string keyName, LoggingLevels levelToLog) { s_configurationFileReader = s_configurationFileReader ?? ConfigurationFileReaderProvider.Service; string value = s_configurationFileReader.GetValue(keyName); if (string.IsNullOrEmpty(value)) { switch (levelToLog) { case LoggingLevels.Info: Log.Info("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.Trace: Log.Trace("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.Warning: Log.Warning("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.Error: Log.Error("Parameter {0} not found in appsettings", keyName); break; case LoggingLevels.None: break; } } return value; }