log4j2 RollingFile on Windows gives "The system cannot find the path specified"
<p>I'm trying to configure log4j2 with a <code>RollingFile</code> appender, in order to have previous log files saved and a fresh logfile per run.</p>

<p>The appender in log4j2.xml is configured as follows:</p>

<pre><code>    &lt;RollingFile name="Logfile" &gt;
        &lt;append value="false" /&gt;
        &lt;filePattern value="log-%d{yyyy-MM-dd_HHmm}.txt" /&gt;
        &lt;fileName value="log.txt" /&gt;
        &lt;PatternLayout pattern="[%d{HH:mm:ss.SSS}] [%N] [%-5level] [%-16t] [%-20logger{36}]: %msg%n"/&gt;
        &lt;Policies&gt;
            &lt;OnStartupTriggeringPolicy /&gt;
        &lt;/Policies&gt;
    &lt;/RollingFile&gt;
</code></pre>

<p>When I run the application, I immediately get the following error:</p>

<pre><code>2016-07-26 12:15:54,888 main ERROR Unable to create file  java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1012)
    ...
2016-07-26 12:15:54,919 main ERROR Null object returned for RollingFile in Appenders.
</code></pre>

<p>Using a simple <code>File</code> appender creates the desired log file within my program directory, so I expected that the <code>RollingFile</code> appender would also be able to handle relative paths. It may does, because absolute paths don't work either. If I prepend the path of my programs directory or the actual value of my <code>%TMP%</code> env var to <code>fileName</code> and <code>filePattern</code>, I get the same error.</p>

<p>So any help on configuring log4j2 for my goals is highly appreciated...</p>