I am having an issue with Nlog not writing logs to the folder mentioned in the config file. This is for windows service we implemented. Whenever we start a service, it writes the logs for few days/hours. But all off a sudden it stops writing the logs. We again needs to restart the service to resolve the issue and issues repeats again.
Please find below the nlog config file and any help to resolve the issue is really appreciated.
<?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">
<targets async="true">
<target name="ApplicationLog" xsi:type="File" layout="<LogEntry><Date>${longdate}</Date><Level>${level}</Level><Message>${message}</Message><StackDump>${stacktrace}</StackDump><Exception>${exception:format=ToString}</Exception></LogEntry>" fileName="D:\ApplicationLogs\Account\account.txt" encoding="iso-8859-2" archiveFileName="D:\ApplicationLogs\Account\Archive\account.{########}.txt" archiveNumbering="Rolling" archiveEvery="Day" archiveAboveSize="20971520" maxArchiveFiles="60" />
<target name="securityLog" xsi:type="File" layout="<LogEntry><Date>${longdate}</Date><Level>${level}</Level><Message>${message}</Message><StackDump>${stacktrace}</StackDump><Exception>${exception:format=ToString}</Exception></LogEntry>" fileName="D:\ApplicationLogs\Account\securityLog.txt" encoding="iso-8859-2" archiveFileName="D:\ApplicationLogs\Account\Archive\securityLog.{########}.txt" archiveNumbering="Rolling" archiveEvery="Day" archiveAboveSize="20971520" maxArchiveFiles="60" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="securityLog" />
<logger name="*" minlevel="Info" writeTo="ApplicationLog" />
</rules>
</nlog>
Thanks