ASP.NET CORE Using NLog, I want to achieve the following:
log file per day. File maximum 10MB. Keep max 30 days of logs, automatically deleting older logs.
"MaxArchiveFiles" does not meet this feature requirement
How to configure this?
My current settings.
<?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"
autoReload="true"
internalLogLevel="info"
internalLogFile="C:\Logs\TestProject\nlog-internal.txt">
<targets>
<!-- write logs to file -->
<target xsi:type="File" name="ALL"
fileName="C:\Logs\TestProject\TestProject.log"
layout="${longdate}|${uppercase:${level}}|${threadid}|${logger}|${message} ${exception}"
maxArchiveFiles="100"
archiveFileName="C:\Logs\TestProject\TestProject.{###}.log"
archiveAboveSize="10485760"
archiveNumbering="Sequence"
concurrentWrites="true"
keepFileOpen="false"
/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="ALL" />
</rules>
</nlog>