views:

18

answers:

1

Rolling comments inside a log4net file

Is it possible to roll the data inside the log file?

So I have an xml config file like

<log4net>
  <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
    <layout type="log4net.Layout.PatternLayout">
      <ConversionPattern value="%d{yyyy-MM-dd hh:mm:ss} – %-5p: %m%n" />
    </layout>
    <param name="File" value="c:\log.txt" />
    <param name="AppendToFile" value="true" /> 
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="1" />
    <maximumFileSize value="5MB" />
    <staticLogFileName value="false" />
  </appender>
  <root>
    <level value="DEBUG" />
    <appender-ref ref="LogFileAppender" />
  </root>
</log4net>

What I want is to have a 5MB file that when it gets to the end will pull off the first line of the file and then add a new line at the end. Is that possible (I do not see it in the documentation)?

A: 

I looked a little more at this and have not seen a solution. My answer may be that it is not available (please correct me if I am wrong).

If it does not exist and really was needed I guess it could updated in log4net?

Maestro1024