public void Configure(ILoggerFactory loggerFactory) { //loggerFactory.AddConsole(LogLevel.Information); loggerFactory.AddProvider(new ReplicatorConsoleLoggingProvider()); var logFileName = _logFileNameProvider.GetLogFileName(); if (!string.IsNullOrEmpty(logFileName)) { loggerFactory.AddSerilog(GetSerilogLoggerConfiguration(logFileName).CreateLogger(), dispose: true); } }
public List <string> GetInfoLinesFromLog(string path) { List <string> infoLines; var logFileFullPath = path + @"\" + _lfnp.GetLogFileName(); string[] lines; try { lines = _fsl.GetStringLinesOfFile(logFileFullPath); } catch (FileSystemLayerFileNotFoundException) { throw new LfgLogFileDoesntExistException(); } if (lines == null || lines.Length == 0) { infoLines = new List <string>(); } else { infoLines = lines.ToList(); } return(infoLines); }
public void WriteLog(ICollection <FileInfoCollector.FileInformations> fileInfo, string path) { _fsl.WriteFile(_fi2ll.RevertAll(fileInfo), path + @"/" + _lfnp.GetLogFileName()); }
public List <FileInfoCollector.FileInformations> Remove(List <FileInfoCollector.FileInformations> informations) { var logFileName = _lfnp.GetLogFileName(); return(informations.Where(x => x.FilePath.Length < logFileName.Length || x.FilePath.Substring(x.FilePath.Length - logFileName.Length) != logFileName).ToList()); }