INTENT:
a) I want my logs to be rolled by date in following file format yyyy-MM-dd.txt.
b) Additionally to this I want to remove old files which are out of maxSizeRollBackups range.
CAUTION A maximum number of backup files when rolling on date/time boundaries is not supported. [RollingFileAppender spec][1]
SOLUTION
for a) is enough to do the configuration
<appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs\" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<maxSizeRollBackups value="30" />
<datePattern value="yyyy-MM-dd'.txt'" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.XmlLayoutSchemaLog4j"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
</appender>
for b) Is the inheritance from RollingFileAppender + delete stuff the only way to achieve this ?