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);
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void WriteLog(ICollection <FileInfoCollector.FileInformations> fileInfo, string path)
 {
     _fsl.WriteFile(_fi2ll.RevertAll(fileInfo), path + @"/" + _lfnp.GetLogFileName());
 }
Esempio n. 4
0
        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());
        }