logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Psenner <dpsen...@gmail.com>
Subject [PATCH 4 of 5] Step 4: use the new functionality
Date Tue, 22 Jan 2013 13:41:08 GMT
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;
 

Mime
View raw message