diff -r 569e06c6cfb3 -r c4b727dc790c src/Appender/RollingFileAppender.cs
--- a/src/Appender/RollingFileAppender.cs Tue Jan 22 14:31:43 2013 +0100
+++ b/src/Appender/RollingFileAppender.cs Tue Jan 22 14:31:58 2013 +0100
@@ -835,6 +835,11 @@
}
}
}
+
+ if (m_rollDate)
+ {
+ DeleteOutdatedFiles();
+ }
}
/// <summary>
@@ -1243,12 +1248,18 @@
{
string from = CombinePath(File, "." +
i);
string to =
CombinePath(m_scheduledFilename, "." + i);
- RollFile(from, to);
+ if (FileExists(from)) // to avoid file
not exists warning because that's legal here
+ {
+ RollFile(from, to);
+ }
}
RollFile(File, m_scheduledFilename);
}
+ //Now we delete files too old to keep (see
m_maxDateRollBackups)
+ DeleteOutdatedFiles();
+
//We've cleared out the old date and are ready for the
new
m_curSizeRollBackups = 0;