I have two JVMs (server1 and server2) running on one Linux Machine. & I want to move logs from default directory to a custom directory for each JVM.
Something like -
/data/logs/$JVM_NAME/
so that final logs get to directories soemthing like
/data/logs/server1/
&
/data/logs/server2/
I learned that jboss.server.log.dir variable can be set in server startup arguments. Then I tried following startup command.
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/ > /tmp/domain.out 2>&1 &
This is working fine. And the logs are getting written in /data/logs/
.
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 /data/logs/$JVM_NAME/.