FileArchivePeriod
has a limited number of options.
public enum FileArchivePeriod
{
/// <summary>
/// Don't archive based on time.
/// </summary>
None,
/// <summary>
/// Archive every year.
/// </summary>
Year,
/// <summary>
/// Archive every month.
/// </summary>
Month,
/// <summary>
/// Archive daily.
/// </summary>
Day,
/// <summary>
/// Archive every hour.
/// </summary>
Hour,
/// <summary>
/// Archive every minute.
/// </summary>
Minute
}
These all have a related formatString
that the FileTarget
class uses as a simple greater than comparison mechanism to see if a new file should be created.
if (this.ArchiveEvery != FileArchivePeriod.None)
{
string formatString = GetDateFormatString(string.Empty); //This is different per period type
string ts = lastWriteTime.ToString(formatString, CultureInfo.InvariantCulture);
string ts2 = ev.TimeStamp.ToLocalTime().ToString(formatString, CultureInfo.InvariantCulture);
if (ts != ts2)
{
return true;
}
}
So while you could definitely customize the code to meet your requirement, it won't do it out of the box (and the simple change would be kind of ugly, IMO).