I have a rolling file appender configured with this:
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="appname" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<datePattern value="'.'yyyyMMdd'.log'" />
<maxSizeRollBackups value="30" />
<maximumFileSize value="10MB" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
This works fine, but I was wondering if there was a way to move the old log files into an “archive” folder, instead of having them moved to the same folder?
You can always open RollingLogFileAppender.cs and modify it to anything you want. It’s open source, mate. And this class is really easy to extend. Personally I hate its naming style for log files, and I have my own RollingLogFileAppender to please me. 🙂