tags:

views:

43

answers:

1

Hello,

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?

+2  A: 

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. :)

Lex Li
I figured it would have to be something like that. At least it gives me the chance to add some more naming customization as you say.
Karma_Police