title: How to change JBoss EAP 6.4 server log directory with server name in path?
body: <p>I have two JVMs (server1 and server2) running on one Linux Machine. &amp; I want to move logs from default directory to a custom directory for each JVM.</p>
  
  <p>Something like -</p>
  
  <pre><code>/data/logs/$JVM_NAME/
  </code></pre>
  
  <p>so that final logs get to directories soemthing like</p>
  
  <pre><code>/data/logs/server1/
  &amp;
  /data/logs/server2/
  </code></pre>
  
  <p>I learned that <code>jboss.server.log.dir</code> variable can be set in server startup arguments. Then I tried following startup command.</p>
  
  <pre><code>nohup sh /appl/isaac/jboss/jboss-eap-6.4/bin/domain.sh -b some.server.domain.com -bmanagement some.server.domain.com -Djboss.domain.log.dir=/data/logs -Djboss.server.log.dir=/data/logs/ &gt; /tmp/domain.out 2&gt;&amp;1 &amp;
  </code></pre>
  
  <p>This is working fine. And the logs are getting written in <code>/data/logs/</code>.</p>
  
  <p>But I am not sure how to add a variable in these arguments to add one more sub directory with JVM name for each JVM on this machine. So that logs gets written to <code>/data/logs/$JVM_NAME/</code>.</p>