I have an NLog configuration file as shown below. For some reason, NLog should work in asynchronous processing.
<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="file" xsi:type="File" fileName="c:/log1.log" archiveEvery="Day" archiveNumbering="Rolling"/>
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="file"/>
</rules>
</nlog>
I would like to know if there is any method that I can use to check if the NLog logging protocols are complete, as shown below:
for (int i = 0; i <= 9999; i++)
{
LogManager.GetCurrentClassLogger().Info("this is for testing " + i);
}
while(!LogManager.finished()) // check if finished or not
{
Console.Write(".");
}
Console.Write("done");
Thank.
Look
llook source
share