A RollingFile Appender for log4net that deletes old logfiles
This appender is available as a NuGet package.
Run Install-Package Net.Bluewalk.log4net.RollingFileByMaxAgeAppender
in the Package Manager Console or search for "RollingFileByMaxAgeAppender" in your IDE's package management plug-in.
Configure your log4net appender to the type
<appender name="file" type="Net.Bluewalk.log4net.RollingFileByMaxAgeAppender.RollingFileByMaxAgeAppender, Net.Bluewalk.log4net.RollingFileByMaxAgeAppender">
You can then use the maxSizeRollBackups
property to define how many logfiles need to be retained.