public static void Init(string configPath, bool inProjectDir = false, ConfiguringOptions options = null) { string path = inProjectDir ? $"{ Directory.GetCurrentDirectory() }/{configPath}" : configPath; ConfigProvider.Run(path, options); StoreManager.RunProcessing(); }
/// <summary> /// Центральный метод определения настроек логгера /// </summary> internal static void Run(string path, ConfiguringOptions options = null) { configFilePath = path; ConfigProvider.options = options; var configFileContent = System.IO.File.ReadAllText(path); try { jsonDoc = JObject.Parse(configFileContent); Config.stores = new StoreSettings(); ParseProjectName(); ParseUsingStores(); ParseTime(); ParseInsideLoggingStore(); jsonDoc = null; } catch (Exception ex) { throw new StruLogConfigException($"Can't parse config or write to: {ex.Message} {ex.StackTrace} \n >>> Check access to config file*, config content*, internet access"); } }