I'm using NLog on an application. I copied over NLog configuration settings from another project. The file looks like this:
<?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">
<!-- make sure to set 'Copy To Output Directory' option for this file -->
<!-- go to http://nlog-project.org/wiki/Configuration_file for more information -->
<targets>
<target name="file" xsi:type="File" fileName="${basedir}/logs/log.txt" />
<target name="errors" xsi:type="File" maxArchiveFiles="7" layout="${longdate}|${level}|${callsite}|${message}|${exception:format=ShortType,StackTrace}" archiveEvery="Day" fileName="${basedir}\logs\exceptions.txt" /> </targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file,errors" />
</rules>
</nlog>
I'm curious what the configuration is specifying, in particular the "archive" options. (i.e. maxArchiveFiles, archiveEvery).
Also, I noticed that currently when I log anything using NLog, it spits out two files. An exceptions.txt file and a log.txt file. I guess I expected that the exceptions file would only contain exceptions (it logs warnings and information to the exceptions text file).
Right now I'm only logging errors/exceptions, so I don't think I even need the logs.txt file if its just the same thing as the exceptions.txt.
C#, NLog v2.0.0.0, ASP.NET 4