为什么 NLog 不再存档
Why is NLog not archiving anymore
我有这个配置
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="bot.log" archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="10" enableArchiveFileCompression="true"/>
<target name="logconsole" xsi:type="Console" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="logconsole" />
<logger name="*" minlevel="Trace" writeTo="logfile" />
</rules>
</nlog>
它以前创建 bot.1.zip、bot.2.zip 等...但现在它总是附加到现有文件,尽管我没有改变任何东西。
我刚刚更新了 NLog,问题依旧。
我不得不在 app.config 中删除 System.IO.Compression 的 bindingRedirect,现在它又可以工作了。
谢谢Julian for troubleshooting steps
我有这个配置
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="bot.log" archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="10" enableArchiveFileCompression="true"/>
<target name="logconsole" xsi:type="Console" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="logconsole" />
<logger name="*" minlevel="Trace" writeTo="logfile" />
</rules>
</nlog>
它以前创建 bot.1.zip、bot.2.zip 等...但现在它总是附加到现有文件,尽管我没有改变任何东西。
我刚刚更新了 NLog,问题依旧。
我不得不在 app.config 中删除 System.IO.Compression 的 bindingRedirect,现在它又可以工作了。
谢谢Julian for troubleshooting steps