Maxsizerollbackups无法正常工作

时间:2016-09-21 04:34:43

标签: log4net

我必须删除超过2天的日志。我的配置是

<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
   <file value=".\Logs\abc_" />
   <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
   <staticLogFileName value="false" />
   <rollingStyle value="Date" />
   <datePattern value="yyyy.MM.dd'.log'" />
   <appendToFile value="true" />
   <maxSizeRollBackups value="2" />
   <layout type="log4net.Layout.PatternLayout">
       <conversionPattern value="[%property{log4net:HostName}] %date [%thread]      [%-5level] %logger -- %message%newline" />
   </layout>
</appender>

但这似乎不起作用。请帮忙!

0 个答案:

没有答案