예제 #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);
     }
 }
예제 #2
0
 public FileLoggerProvider(FileLoggerOptions options)
 {
     _filter = options.Filter ?? trueFilter;
     UpdateOptions(options);
 }