private void RollOverIfDateBoundaryCrossing()
{
if (!_staticLogFileName || !_rollDate || !FileExists(_baseFileName))
{
return;
}
DateTime lastWriteTime;
using (SecurityContext.Impersonate(this))
{
lastWriteTime = System.IO.File.GetLastWriteTime(_baseFileName);
}
LogLog.Debug("RollingFileAppender: [" +
lastWriteTime.ToString(ActivityLogFile.FileDatePattern, DateTimeFormatInfo.InvariantInfo) + "] vs. [" +
_now.ToString(ActivityLogFile.FileDatePattern, DateTimeFormatInfo.InvariantInfo) + "]");
if (lastWriteTime.ToString(ActivityLogFile.FileDatePattern, DateTimeFormatInfo.InvariantInfo)
.Equals(_now.ToString(ActivityLogFile.FileDatePattern, DateTimeFormatInfo.InvariantInfo)))
{
return;
}
_scheduledFilename = ActivityLogFile.ComposeFileName(_baseFileName, lastWriteTime);
LogLog.Debug("RollingFileAppender: Initial roll over to [" + _scheduledFilename + "]");
RollOverTime(false);
LogLog.Debug("RollingFileAppender: curSizeRollBackups after rollOver at [" + _curSizeRollBackups + "]");
}