我有以下log4net的配置:log4net的滾動文件Appender的滾動發行
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="Logs/%date{yyyy-MM-dd} Service.log" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<maxSizeRollBackups value="100"/>
<maximumFileSize value="15MB"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level %logger: %message%newline" />
</layout>
</appender>
數據將被不斷記錄到日誌文件並回滾OK,但我最終推出的文件是這樣的:
2009-12-21 Service.log2009-12-22 (this is what it will write tonight)
2009-12-21 Service.log <-- this being the latest file
2009-12-21 Service.log2009-12-21 <-- last updated 23:59
我想要的文件,如:
2009-12-21 Service.log
2009-12-22 Service.log
2009-12-23 Service.log
我不跟隨..你想防止什麼? – 2009-12-21 23:32:37
Mauricio我想阻止它寫這樣的日誌文件2009-12-21 Service.log2009-12-21它應該是2009-12-21 Service.log 2009-12-22 Service.log 2009-12-23 Service.log – 2009-12-22 01:04:37