Is there a way to move old log files from log4net RollingLogFileAppender to another folder?

I have a copied application file 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 is a way to move the old log files to the archive folder, instead of moving them to the same folder?

+6
c # log4net
source share
1 answer

You can always open RollingLogFileAppender.cs and change it to whatever you want. It is an open source helper. And this class is very easy to distribute. Personally, I hate his naming style for log files, and I have my own RollingLogFileAppender to like me. :)

+3
source share

All Articles