Пример #1
0
 public FileLoggerProvider(FileLogSettings settings)
 {
     _settings = settings;
     if (!System.IO.File.Exists(_settings.FilePath))
     {
         System.IO.File.Create(_settings.FilePath);
     }
 }
Пример #2
0
 public FileLogger(FileLogSettings settings, string categoryName)
 {
     _settings     = settings;
     _categoryName = categoryName;
 }
Пример #3
0
 public static ILoggingBuilder AddFile(this ILoggingBuilder builder, FileLogSettings settings)
 {
     builder.Services.AddSingleton <ILoggerProvider>(new FileLoggerProvider(settings));
     return(builder);
 }