.net - Delete nlog files after one month of time -



.net - Delete nlog files after one month of time -

i want delete nlog files after 1 month time. add together next configurations nlog config file

<targets> <target name="file" xsi:type="file" layout="${longdate} ${logger} ${message}" filename="${basedir}/logs/logfile.txt" archivefilename="${basedir}/logs/log.{#}.txt" archiveevery="month" archivenumbering="rolling" maxarchivefiles="7" concurrentwrites="true" /> </targets>

but files older 1 month still exists in nlog folder.

your configuration set start new log file every month , maxarchivefiles set 7, oldest archive deleted after 7 months. 1 alternative alter maxarchivefiles 1.

.net nlog

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -