You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "Haufe, Toni" <T....@itcampus.de> on 2009/02/19 12:55:36 UTC

How to keep only logs of the last 5 days?

Hi all,

I configured log4net using a RollingFileAppender that rolls the log file on a daily basis.
So I've tried to use rollingStyle=Date. (Or Composite). But that keeps me at least 1 file a day.

How can I configure log4net to keep only log files of the last 5 days? (Older log files should be deleted like using "rollingStyle=Size" and maxSizeRollBackups = 5)

Is there a way to achieve that?

Thanks in advance,

Toni