我有一个 log4net 的配置如下:
<log4net>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="C:\...\log-file.txt" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value ="Start new file proccessing..."/>
<conversionPattern value="%newline%date - %message%exception" />
<footer value ="Finish with the proccessing"/>
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
它工作正常,但我希望我可以在页脚之后添加一个新行,所以当我多次附加到我的日志文件时,上一次运行的页脚不会与开头(页眉)保持在同一行第二次运行。
例子:
Operation started..
....
Operation endedOperationStarted
....
Operation ended
我希望我可以让它看起来像:
Operation started..
....
Operation ended
OperationStarted
....
Operation ended