Thanks for tip. I will add that and see what happens. Will let you know.

One thing, you have put there the link to the log4net config examples,
however none of them seem to be using the property you just mention.

Also I found this: https://issues.apache.org/jira/browse/LOG4NET-208



Ron Grabowski wrote:
> 
> 
> What happens when you add <RollingMode value="Size" />?
> 
> http://logging.apache.org/log4net/release/config-examples.html
> 
> 
> 
> ----- Original Message ----
> From: M.Suarez <moc...@gmail.com>
> To: log4net-user@logging.apache.org
> Sent: Monday, June 15, 2009 5:21:24 PM
> Subject: Deleting old logs
> 
> 
> Hi,
> 
> I am trying to just have the latest 2 log files of my application, thus I
> have configured the log4net as follows:
> 
> <log4net>
>     <appender name="RollingFile"
> type="log4net.Appender.RollingFileAppender">
>       <file value="d:\netapps\logfiles\MyApp.log" />
>       <appendToFile value="true" />
>     <MaximumFileSize value="100KB"/>
>     <MaxSizeRollBackups value="2" />
>       <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
> 
>       <layout type="log4net.Layout.PatternLayout">
>         <conversionPattern value="%date [%thread] %-5level %logger -
> %message%newline" />
>       </layout>
>     </appender>
> 
>     <!-- Set root logger level to INFO and its only appender to Console
> and
> RollingFile-->
>     <root>
>       <level value="INFO" />
>       <appender-ref ref="RollingFile" />
>     </root>
>   </log4net>
> 
> However, there will be more than then two expected log files, this is
> because:
> "The maximum applies to each time based group of files and not the total" 
> (http://logging.apache.org/log4net/release/sdk/log4net.Appender.RollingFileAppender.MaxSizeRollBackups.html)
> 
> How should I configure log4net then to only store the latest two files?
> Any
> help will be greatly appreciate it.
> 
> Regards,
> Monica
> -- 
> View this message in context:
> http://www.nabble.com/Deleting-old-logs-tp24042093p24042093.html
> Sent from the Log4net - Users mailing list archive at Nabble.com.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Deleting-old-logs-tp24042093p24099610.html
Sent from the Log4net - Users mailing list archive at Nabble.com.

Reply via email to