Ejemplo n.º 1
0
        /// <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);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Get log file name by current date
 /// </summary>
 /// <returns>File name</returns>
 internal static string GetLogFileName() => $"{LoggerUtilities.GetLogDate()}.{LoggerConfiguration.LogsExtension}";