Closed
Description
Can we allow different action on obsolete files ?
I think it would be beneficial in situation when old logs should be archived by moving to different folder or different server (dedicated only for logs)
/// Action that should be preformed on obsolete(old) log files
public static Action<string> OnObsoleteFile = null;
Inside remove loop:
foreach (var obsolete in toRemove)
{
var fullPath = Path.Combine(_roller.LogFileDirectory, obsolete);
try
{
if(OnObsoleteFile!= null)
OnObsoleteFile.Invoke(fullPath);
else
{
System.IO.File.Delete(fullPath);
}
}
catch (Exception ex)
{
SelfLog.WriteLine("Error {0} while processing obsolete file {1}", ex, fullPath);
}
}
It is more like example, not working code :)
Metadata
Metadata
Assignees
Labels
No labels