public SimpleFileLoggerProvider(IOptions <SimpleFileLoggerOptions> simplestFileLoggerOptionsOptions, IOptions <LoggerFilterOptions> loggerFilterOptionsOptions)
        {
            var rawLogFilePath = simplestFileLoggerOptionsOptions.Value.LogFilePath;

            this.LogFilePath = PathUtilitiesExtra.EnsureDirectorySeparator(rawLogFilePath);

            var overwrite = simplestFileLoggerOptionsOptions.Value.Overwrite;

            if (overwrite)
            {
                if (File.Exists(this.LogFilePath))
                {
                    File.Delete(this.LogFilePath);
                }
            }

            var loggerFilterOptions = loggerFilterOptionsOptions.Value;

            // Get the logger filter rules for the specific provider.
            var filterRules = loggerFilterOptions.Rules.Where(x => x.ProviderName == SimpleFileLoggerProvider.ProviderAliasName).ToList();

            if (filterRules.Count < 1)
            {
                // Use the general rules instead.
                filterRules = loggerFilterOptions.Rules.Where(x => x.ProviderName == null).ToList();
            }

            foreach (var filterRule in filterRules)
            {
                this.LogLevelsByCategoryName.Add(filterRule.CategoryName ?? Utilities.DefaultCategoryName, filterRule.LogLevel ?? LogLevel.None);
            }
        }
        public SimplestFileLoggerProvider(IOptions <SimplestFileLoggerOptions> simplestFileLoggerOptionsOptions)
        {
            var rawLogFilePath = simplestFileLoggerOptionsOptions.Value.LogFilePath;

            this.LogFilePath = PathUtilitiesExtra.EnsureDirectorySeparator(rawLogFilePath);

            var overwrite = simplestFileLoggerOptionsOptions.Value.Overwrite;

            if (overwrite)
            {
                if (File.Exists(this.LogFilePath))
                {
                    File.Delete(this.LogFilePath);
                }
            }
        }