internal FileLogger(string name, FileLoggerProcessor loggerProcessor)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            _name           = name;
            _queueProcessor = loggerProcessor;
        }
Пример #2
0
        /// Creates an instance of <see cref="FileLoggerProvider"/>.
        /// </summary>
        /// <param name="options">The options to create <see cref="FileLogger"/> instances with.</param>
        /// <param name="formatters">Log formatters added for <see cref="FileLogger"/> insteaces.</param>
        public FileLoggerProvider(IOptionsMonitor <FileLoggerOptions> options, IEnumerable <FileFormatter> formatters)
        {
            this.options = options;
            this.loggers = new ConcurrentDictionary <string, FileLogger>();

            SetFormatters(formatters);
            this.messageQueue = new FileLoggerProcessor(options.CurrentValue);

            optionsReloadToken = this.options.OnChange(ReloadLoggerOptions);

            ReloadFormatters(options.CurrentValue);
        }