예제 #1
0
        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();
        }
예제 #2
0
        /// <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");
            }
        }