/// <summary> /// Archive old logs /// </summary> internal static void CheckOldFiles() { var d = new DirectoryInfo(LoggerConfiguration.LogsDir); foreach (var file in d.GetFiles($"*.{LoggerConfiguration.LogsExtension}")) { var date = LoggerUtilities.GetLogDate(); if (!file.Name.Equals($"{date}.{LoggerConfiguration.LogsExtension}")) { ArchiveFile(file); } } }
/// <summary> /// Get log file name by current date /// </summary> /// <returns>File name</returns> internal static string GetLogFileName() => $"{LoggerUtilities.GetLogDate()}.{LoggerConfiguration.LogsExtension}";