3 Replies Latest reply on Mar 6, 2014 2:15 AM by sndaemon

    How to print the verboseGC log into ${jboss.server.log.dir}

    sndaemon

      Hi,

           I want to print each server's verboseGC log into there own ${jboss.server.log.dir}.

           For example:

           /opt/WildFly8.0.0-release/domain/servers/server-one/log/verbose.gc

           /opt/WildFly8.0.0-release/domain/servers/server-two/log/verbose.gc

           /opt/WildFly8.0.0-release/domain/servers/server-three/log/verbose.gc


           I tried to config like this in host.xml:

      <jvms>
           <jvm name="default">
                <heap size="64m" max-size="256m"/>
                <permgen size="256m" max-size="256m"/>
                <option value="-server"/>
                <option value="-verbose:gc"/>
                <option value="-XX:+UseConcMarkSweepGC"/>
                <option value="-XX:+PrintGCDetails"/>
                <option value="-XX:+PrintGCTimeStamps"/>
                <option value="-XX:+PrintHeapAtGC"/>
                <option value="-Xloggc:${jboss.server.log.dir}/verbose.gc"/>
           </jvm>
      </jvms>
      

              

           It was wrong!

       

      [Host Controller] Caused by: org.jboss.as.controller.OperationFailedException [ "JBAS014802: Cannot resolve expression 'expression \"-Xloggc:${jboss.server.log.dir}/verbose.gc\"' -- java.lang.IllegalStateException: Failed to resolve expression: ${jboss.server.log.dir}" ]

       

           Any body know how to config?Thanks.

        • 1. Re: How to print the verboseGC log into ${jboss.server.log.dir}
          ksreen

          $jboss.server.log.dir is not recoginzed. Hence try the following. For each server that you want the verbose.gc output, override the default jvm in host.xml as follows

          ----------------------------------------------------------------------------------------------------------

          <server name="server-one" group="main-server-group">

                       <jvm name="default">

                        <jvm-options>

                         <option value="-Xloggc:domain/servers/server-one/log/verbose.gc"/>

                        </jvm-options>

                     </jvm>

          ----------------------------------------------------------------------------------------------------------

          Continue to have

          <jvms>

              <jvm name="default">

                    <heap size="64m" max-size="256m"/>

                    <permgen size="256m" max-size="256m"/>

                      <jvm-options>

                          <option value="-server"/>

                           <option value="-verbose:gc"/> 

                    <option value="-XX:+UseConcMarkSweepGC"/> 

                    <option value="-XX:+PrintGCDetails"/> 

                  <option value="-XX:+PrintGCTimeStamps"/> 

                    <option value="-XX:+PrintHeapAtGC"/> 

                      </jvm-options>

                 </jvm>

            </jvms>

          Hope this helps

          • 2. Re: How to print the verboseGC log into ${jboss.server.log.dir}
            brian.stansberry

            The <option value="-Xloggc:${jboss.server.log.dir}/verbose.gc"/> setting doesn't work because that expression is evaluated on the Host Controller process, which is the one that launches the server jvm. A server-specific system property like jboss.server.log.dir doesn't exist in the Host Controller process.

             

            It's theoretically possible for the Host Controller to be a bit more smart about expression resolution and include some extra key/value pairs in the resolution algorithm. That is, determine what system properties it would pass to the server VM when it launches it and include those in the expression resolution. I say theoretically possible, because there's a bit of a chicken-and-egg problem here, and it won't be trivial to do.

             

            If it's important to you, feel free to file a Feature Request in JIRA. I can't promise we'd be able to do it though.

            1 of 1 people found this helpful
            • 3. Re: How to print the verboseGC log into ${jboss.server.log.dir}
              sndaemon

              Thanks very much for your explain. It doesn't matter but a repeated work.Whatever,it works.