update ConcatinatingAndCompressingFiles
This commit is contained in:
parent
907fa27180
commit
4e6dcb9895
|
@ -25,7 +25,7 @@ public class LogFileConcatenator
|
||||||
foreach (var fileContent in logFiles.Select(File.ReadAllText))
|
foreach (var fileContent in logFiles.Select(File.ReadAllText))
|
||||||
{
|
{
|
||||||
concatenatedContent.AppendLine(fileContent);
|
concatenatedContent.AppendLine(fileContent);
|
||||||
concatenatedContent.AppendLine(); // Append an empty line to separate the files // maybe we don't need this
|
//concatenatedContent.AppendLine(); // Append an empty line to separate the files // maybe we don't need this
|
||||||
}
|
}
|
||||||
|
|
||||||
return concatenatedContent.ToString();
|
return concatenatedContent.ToString();
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class CustomLogger : ILogger
|
||||||
File.Delete(logFiles.First());
|
File.Delete(logFiles.First());
|
||||||
}
|
}
|
||||||
|
|
||||||
var timestamp = DateTime.Now.ToUnixTime() + Environment.NewLine;
|
var timestamp = "Timestamp;" + DateTime.Now.ToUnixTime() + Environment.NewLine;
|
||||||
|
|
||||||
var logFileBackupPath = Path.Combine(logFileDir, $"{logFileBaseName}_{DateTime.Now.ToUnixTime()}{logFileExt}");
|
var logFileBackupPath = Path.Combine(logFileDir, $"{logFileBaseName}_{DateTime.Now.ToUnixTime()}{logFileExt}");
|
||||||
File.AppendAllText(logFileBackupPath, timestamp + logMessage + Environment.NewLine);
|
File.AppendAllText(logFileBackupPath, timestamp + logMessage + Environment.NewLine);
|
||||||
|
|
|
@ -705,8 +705,6 @@ internal static class Program
|
||||||
var logFileConcatenator = new LogFileConcatenator();
|
var logFileConcatenator = new LogFileConcatenator();
|
||||||
var csvToSend = logFileConcatenator.ConcatenateFiles(NbrOfFileToConcatenate);
|
var csvToSend = logFileConcatenator.ConcatenateFiles(NbrOfFileToConcatenate);
|
||||||
|
|
||||||
File.WriteAllText("test.csv",csvToSend);
|
|
||||||
|
|
||||||
var s3Path = timeStamp.ToUnixTime() + ".csv";
|
var s3Path = timeStamp.ToUnixTime() + ".csv";
|
||||||
var request = s3Config.CreatePutRequest(s3Path);
|
var request = s3Config.CreatePutRequest(s3Path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue