У меня есть настройка NLog ниже:
<target name="asyncFile" xsi:type="AsyncWrapper" queueLimit="10000" overflowAction="Block">
<target xsi:type="File"
fileName="/storage/sdcard0/com.my.app/Logs/${shortdate}.log"
archiveFileName="/storage/sdcard0/com.my.app/Logs/archived.{#}.log"
maxArchiveFiles="5"
archiveDateFormat="yyyy-MM-dd"
archiveAboveSize="1048576"
archiveEvery="Day"
archiveNumbering="DateAndSequence"
concurrentWrites="true"
keepFileOpen="false">
<layout xsi:type="JsonLayout" includeAllProperties="true" excludeProperties="Comma-separated list (string)">
<attribute name="time" layout="${longdate}" />
<attribute name="level" layout="${level:upperCase=true}"/>
<attribute name="message" layout="${message}" />
<attribute name="exception" layout="${exception}" />
<attribute name="threadid" layout="${threadid}" />
</layout>
</target>
</target>
Ожидаемое поведение: создается не более 5 архивных файлов, каждый из которых имеет максимальный размер 1 МБ.
archived.1.log
archived.2.log
archived.3.log
archived.4.log
archived.5.log
Фактическое поведение: один архивный файл имеет больше 40 МБ
Есть идеи?