/// <summary> /// Creates an instance of <see cref="FileLoggerProvider"/>. /// </summary> /// <param name="options">The options to create <see cref="FileLogger"/> instances with.</param> public FileLoggerProvider(IOptions <FileLoggerOptions> options) { Options = options.Value; if (!Directory.Exists(Options.FilePath)) { Directory.CreateDirectory(Options.FilePath); } }
public FileLogger(string catalogName, Func <string, LogLevel, bool> filter, FileLoggerOptions options) { if (options == null) { throw new ArgumentNullException("FileLoggerOptions"); } this.catalogName = catalogName; this.filter = filter; this.options = options; EnsurePath(); GenerateFilePath(); }
public FileLoggerProvider(Func <string, LogLevel, bool> filter, IOptionsMonitor <FileLoggerOptions> options) { if (options == null) { this.options = new FileLoggerOptions(); } else { this.options = options.CurrentValue; _reloadChangeToken = options.OnChange(Reload); } this.filter = filter; }
public void Reload(FileLoggerOptions options) { this.options = options; }