0 Replies Latest reply on Jul 12, 2016 8:22 AM by evade227

    Is it possible to use JBoss environmental variables in JVM options?

    evade227

      Hello,

       

      I am trying to find the easiest way to turn on Garbage Collection for monitoring for all of my hosts in a domain. For now, I've been using the host-slave.xml one one of the hosts to do some testing and make sure the configuration parameters are correct. However, upon wanting to move this over to my domain.xml file I've run into the issue where I don't know how I can use the ${jboss.server.log.dir} variable to put the logs in each hosts log folder.

       

      To verify the settings were originally working I had the below

       

      <jvm name="default">
                  <jvm-options>
                      <option value="-server"/>
                      <option value="-XX:+AggressiveOpts"/>
                      <option value="-XX:+DoEscapeAnalysis"/>
                      <option value="-XX:+UseCompressedOops"/>
                      <option value="-XX:+UseG1GC"/>
                      <option value="-XX:MaxGCPauseMillis=500"/>
                      <option value="-XX:+UseLargePages"/>
                      <option value="-XX:+PrintGC"/>
                      <option value="-XX:+PrintGCDetails"/>
                      <option value="-XX:+PrintGCTimeStamps"/>
                      <option value="-XX:+PrintGCDateStamps"/>
                      <option value="-XX:+PrintHeapAtGC"/>
                      <option value="-XX:+PrintGCApplicationStoppedTime"/>
                      <option value="-Xloggc:/path/to/server/logs/gc.log"/>
                      <option value="-XX:+UseGCLogFileRotation"/>
                      <option value="-XX:NumberOfGCLogFiles=3"/>
                      <option value="-XX:GCLogFileSize=50M"/>
                      <option value="-XX:+HeapDumpOnOutOfMemoryError"/>
                      <option value="-XX:HeapDumpPath=/path/to/server/logs/heapdump.hprof"/>           
                  </jvm-options>
                  </jvm>
      

       

      Which correctly added the gc.log and heapdump.hprof logs to the hosts server log directory.

       

      However, if I try and use the environment variable so I could add this to my domain.xml and have it deploy the logs to each server as it came online it throws a syntax error for ${jboss.server.log.dir} and treats $jboss.server.log.dir as a string.

       

      Is it possible to include a JBoss Environment Variable in JVM options like it is other places?

       

      Thanks