Vad*_*dim 13 .net nlog overwrite
重启应用程序时,我需要NLog覆盖日志文件.目前它附加到现有文件.例如,我在NLog.config中有这样的东西
<targets>
<target xsi:type="File" name="fileLog"
fileName="${longdate}.log" layout="${message}" />
</targets>
Run Code Online (Sandbox Code Playgroud)
如果我能够添加到<target>这样的东西,那将是很好的append="false",而不是附加到现有的日志,它将覆盖.
bur*_*ION 20
替换您的配置部分
<targets>
<target xsi:type="File" name="fileLog"
fileName="${longdate}.log" layout="${message}" deleteOldFileOnStartup="true"/>
</targets>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4231 次 |
| 最近记录: |