It is not possible to limit the number of archive files generated by the RollingFileAppender in Date mode. The MaxSizeRollBackups property controls the number of size rolled archive files per date period when in Composite mode.
Perhaps you can use a scheduled task to delete log files that are older than 1 week. Nicko > -----Original Message----- > From: Raymond Chan - Symmetrics [mailto:[EMAIL PROTECTED] > Sent: 19 July 2005 21:09 > To: [email protected] > Subject: RollingFileAppender - MaxSizeRollBakups > > Hello, > > I am using the RollingFileAppender and trying to accomplish > the following: > > I want my log files to be rolled over daily, and then > overwritten/deleted each week. > > i.e. I only want to keep 7 backup log files. > > > > Looking at the SDK documentation, it suggests that > MaxSizeRollBackups should work. > > I have the following in my XML Config file (I'm using > rollover by the minute level for testing). I can't seem to > get it to work. Suggestions? > > > > <appender name="DebugRollingAppender" > type="log4net.Appender.RollingFileAppender"> > > <param name="File" > value="logs/nVision.log" /> > > <param > name="AppendToFile" value="true" /> > > <param > name="RollingStyle" value="Composite" /> > > <param name="MaxSizeRollBackups" value="1" /> > > <param name="datePattern" > value="yyyyMMdd-HHmm'.log'" /> > > <param > name="staticLogFileName" value="true" /> > > <layout > type="log4net.Layout.PatternLayout"> > > <param > name="Header" value="[Log Start]%newline" > type="log4net.Util.PatternString"/> > > <param > name="Footer" value="[Log End]%newline" > type="log4net.Util.PatternString"/> > > <param > name="ConversionPattern" value="%d %-5p (%C{1}:%M:%L) - %m%n" /> > > </layout> > > </appender> > > > > p.s. I believe I have v 1.2.9, downloaded ~June2005. > > > > Thanks! > > > > Raymond > >
