I believe that is the point of the maxBackupIndex setting<http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#setMaxBackupIndex(int)> on RollingFileAppender. I'm not 100% sure what the xml for it is as I always roll based on file size but it shouldn't be too hard to google or guess.
On Tue, Feb 18, 2014 at 8:56 AM, moonstone <[email protected]> wrote: > Thanks for your reply. I was not clear in stating my goal. The > application > runs once per day. With the log4net configuration that I have currently, I > get 1 log file each day with the date in the file name. The number of log > files increases by one each day. A user has to delete old log files by > sorting on the file date and deleting the oldest ones. The customer only > wants to keep the log files from the last 3 runs of the application. I can > write the code to delete the old files, but I thought I should check if > log4net can do it. > > My configuration is shown below: > <appender name="RollingLogFileAppender" > type="log4net.Appender.RollingFileAppender"> > > > <datePattern value="'.'yyyy-MM-dd'.txt'" /> > > > > > > <layout type="log4net.Layout.PatternLayout"> > > > > </layout> > </appender> > > > > > -- > View this message in context: > http://apache-logging.6191.n7.nabble.com/how-to-keep-3-days-of-logs-tp44594p44630.html > Sent from the Log4net - Users mailing list archive at Nabble.com. >
