Try this

<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="log.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="-1" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<countDirection value="0" />
<param name="DatePattern" value=" logyyMMddHHmmss.txt" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>

On 1/13/2011 8:28 PM, cyz wrote:
Hi, I'd like to have a logging system with below behaviors, is
RollingFileAppender able to achieve?
1>  messages are logged to a fixed file name, say log.txt.
2>  log files are auto backup by sizes. I.e. when log.txt hits the configured
size, it's renamed as logyyMMddHHmmss.txt, next message coming in will be
written to log.txt again.
3>  there is no limit on how many files can be backup.

Thank you.

Reply via email to