Exemplo n.º 1
0
 private void UpdateOptions(FileLoggerOptions options)
 {
     if (RollingFrequency.TryGetRollingFrequency(options.Path, out var r))
     {
         _msgWriter = new RollingFileWriter(options.Path, options.FileSizeLimit, options.RetainedFileCountLimit);
     }
     else
     {
         _msgWriter = new FileWriter(options.Path, options.FileSizeLimit);
     }
     if (options.IsEnabledBatching)
     {
         _msgWriter = new BatchingWriter(_msgWriter, options.FlushPeriod, options.BatchSize, options.BackgroundQueueSize);
     }
 }
Exemplo n.º 2
0
 public FileLoggerProvider(FileLoggerOptions options)
 {
     _filter = options.Filter ?? trueFilter;
     UpdateOptions(options);
 }