title: NLog 2.0.1 Daily Archiving of log files
body: <p>I have been trying to get my logging working so that I can maintain a 2 week archive of daily logs.</p>
  
  <p>From looking at the official documentation and <a href="https://stackoverflow.com/questions/8036681/nlog-rotate-and-cleanup-logfiles">this question</a>, I have added the following to my NLog.config file target</p>
  
  <pre><code>&lt;target name="file"
          xsi:type="File"
          fileName="${basedir}/../logs/${shortdate}.log"
          archiveFileName="${basedir}/../logs/archive/archive.${shortdate}.{#}.txt"
          archiveEvery="Day"
          archiveNumbering="Rolling"
          maxArchiveFiles="14" /&gt;
  </code></pre>
  
  <p>My understanding is that this should on detection of a new day, create the <code>archive.${shortdate}.{#}.txt</code> file in the archive folder.</p>
  
  <p>What I am actually seeing is that a new log file is generated for each day which is expected, but the archiving is never occurring.</p>
  
  <p>Am I configuring this wrongly, or is there something different you need to do to get this to work with NLog 2.0.1</p>
  
  <p>Note that I am testing this my just manually changing my computer's date settings, although I have had it running over night once and still nothing was archived.</p>
  
  <p>Edit:
  I have been able to get some archiving working if I change the target to archive based on file size like so:</p>
  
  <pre><code>&lt;target name="file"
          xsi:type="File"
          fileName="${basedir}/../logs/${shortdate}.log"
          archiveFileName="${basedir}/../logs/archive/archive.${shortdate}.{#}.txt"
          archiveAboveSize="51200"
          archiveNumbering="Rolling"
          maxArchiveFiles="14" /&gt;
  </code></pre>
  
  <p>So just seems to be something wrong in the day archiving</p>