Log4J2 not logging on all clients
<p>I'm having a weird issue. In my application, I make use of Log4j2 to log to the console and to a file. </p>

<p><strong>Configuration file:</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Configuration status="warn" name="myClient" packages=""&gt;
    &lt;Appenders&gt;
        &lt;Console name="STDOUT" target="SYSTEM_OUT"&gt;
            &lt;PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36}::%M - %msg%n"/&gt;
        &lt;/Console&gt;
        &lt;RollingFile name="logfile" fileName="${java.io.tmpdir}/my_client.log" filePattern="${java.io.tmpdir}/my_client-%d{yyyy-MM-dd}-%i.log" immediateFlush="true" append="false"&gt;
            &lt;PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36}::%M - %msg%n"/&gt;
            &lt;Policies&gt;
                &lt;SizeBasedTriggeringPolicy size="20 MB"/&gt;
            &lt;/Policies&gt;
            &lt;DefaultRolloverSTrategy max="1"/&gt;
        &lt;/RollingFile&gt;
    &lt;/Appenders&gt;
    &lt;Loggers&gt;
        &lt;Root level="trace"&gt;
            &lt;AppenderRef ref="STDOUT"/&gt;
            &lt;AppenderRef ref="logfile"/&gt;
        &lt;/Root&gt;
    &lt;/Loggers&gt;
&lt;/Configuration&gt;
</code></pre>

<p>I build and sign my client, and the user can start it by downloading a JNLP file. Now here is the strange part:</p>

<p>It works on my development machine (launched by the JNLP file), the log file 'my_client.log' gets created and logs nicely. However, it seems to do nothing at all on other machines (launched by the same JNLP file). It seems the log file is never created?</p>

<p>I tracked down some info about the two machines:</p>

<p><strong>Development:</strong></p>

<pre><code>java.version=1.8.0_102
javafx.runtime.version=8.0.102-b14
java.home=C:\Program Files\Java\jre1.8.0_102
java.io.tmpdir=C:\Users\username\AppData\Local\Temp\
os.name=Windows 10
os.version=10.0
os.arch=amd64
</code></pre>

<p><strong>Other machine:</strong> (I changed the actual username by <em>username</em>)</p>

<pre><code>java.version=1.8.0_102
javafx.runtime.version=8.0.102-b14
java.home=C:\Program Files\Java\jre1.8.0_102
java.io.tmpdir=C:\Users\username\AppData\Local\Temp\
os.name=Windows 10
os.version=10.0
os.arch=amd64
</code></pre>

<p>As you can see, the variables seem to be identical on both machines.
Why isn't it logging on both machines? Is there anything else I can do to debug this issue?</p>

<h2>Update</h2>

<p>I have found following error messages in the Java console when I start the JNLP file:</p>

<pre><code>2016-10-12 09:56:27,412 JavaFX Application Thread ERROR Unable to create file C:\\Users\\username\\AppData\\Local\\Temp\\/my_client.log java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(Unknown Source)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:409)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:391)
    at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:73)
    at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:81)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:98)
    at org.apache.logging.log4j.core.appender.RollingFileAppender.createAppender(RollingFileAppender.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:132)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:918)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:858)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:850)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:479)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:219)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:231)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:491)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:561)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:577)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:212)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
    at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:551)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:537)
    at my_client.ui.MainApp.&lt;clinit&gt;(MainApp.java:40)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.javafx.applet.FXApplet2$1.call(FXApplet2.java:67)
    at com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit$Caller.run(FXPluginToolkit.java:347)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    at java.lang.Thread.run(Unknown Source)

2016-10-12 09:56:27,415 JavaFX Application Thread ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile. java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:132)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:918)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:858)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:850)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:479)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:219)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:231)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:491)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:561)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:577)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:212)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
    at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:551)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:537)
    at my_client.ui.MainApp.&lt;clinit&gt;(MainApp.java:40)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.javafx.applet.FXApplet2$1.call(FXApplet2.java:67)
    at com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit$Caller.run(FXPluginToolkit.java:347)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@15bdc6b] unable to create manager for [C:\\Users\\username\\AppData\\Local\\Temp\\/my_client.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@dbdcaae[pattern=C:\\Users\\username\\AppData\\Local\\Temp\\/my_client-%d{yyyy-MM-dd}-%i.log, append=false, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=20971520)]), strategy=DefaultRolloverStrategy(min=1, max=1), advertiseURI=null, layout=%d{yyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36}::%M - %msg%n]]
    at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:75)
    at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:81)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:98)
    at org.apache.logging.log4j.core.appender.RollingFileAppender.createAppender(RollingFileAppender.java:191)
    ... 35 more

2016-10-12 09:56:27,417 JavaFX Application Thread ERROR Null object returned for RollingFile in Appenders.
2016-10-12 09:56:27,422 JavaFX Application Thread ERROR Unable to locate appender "logfile" for logger config "root" 
</code></pre>

<p>I guess I should remove the "/" before my_client.log then?</p>