1 Reply Latest reply on Jun 26, 2014 11:02 AM by Muthu Krishnan

    How to change logging location for Jboss 7.1.1 final multiple instance running as windows service

    Muthu Krishnan Newbie

      Service.bat file contains

       

      :cmdStart

      REM Executed on service start

      del .r.lock 2>&1 | findstr /C:"being used" > nul

      if not errorlevel 1 (

        echo Could not continue. Locking file already in use.

        goto cmdEnd

      )

      echo Y > .r.lock

      jbosssvc.exe -p 1 "Starting %SVCDISP%" > E:\App_Server\jboss-as-7.1.1.Final\standalone\log\standalone.log

      call standalone.bat -b 192.168.6.24 --server-config=standalone.xml < .r.lock >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\standalone.log 2>&1

      jbosssvc.exe -p 1 "Shutdown %SVCDISP% service" >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\standalone.log

      del .r.lock

      goto cmdEnd

       

       

      :cmdStop

      REM Executed on service stop

      echo Y > .s.lock

      jbosssvc.exe -p 1 "Shutting down %SVCDISP%" > E:\App_Server\jboss-as-7.1.1.Final\standalone\log\shutdown.log

      call jboss-cli.bat -c --controller=127.0.0.1:9999 command=:shutdown >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\shutdown.log 2>&1

      jbosssvc.exe -p 1 "Shutdown %SVCDISP% service" >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\shutdown.log

      del .s.lock

      goto cmdEnd

       

       

      :cmdRestart

      REM Executed manually from command line

      REM Note: We can only stop and start

      echo Y > .s.lock

      jbosssvc.exe -p 1 "Shutting down %SVCDISP%" >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\shutdown.log

      call jboss-cli.bat -c --controller=127.0.0.1:9999 command=:shutdown >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\shutdown.log 2>&1

      del .s.lock

      :waitRun

      REM Delete lock file

      del .r.lock > nul 2>&1

      REM Wait one second if lock file exist

      jbosssvc.exe -s 1

      if exist ".r.lock" goto waitRun

      echo Y > .r.lock

      jbosssvc.exe -p 1 "Restarting %SVCDISP%" >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\standalone.log

      call standalone.bat -b 192.168.6.24 --server-config=standalone.xml < .r.lock >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\standalone.log 2>&1

      jbosssvc.exe -p 1 "Shutdown %SVCDISP% service" >> E:\App_Server\jboss-as-7.1.1.Final\standalone\log\standalone.log

      del .r.lock

      goto cmdEnd

       

       

       

      standalone.xml contains below logging configuration.

       

      <profile>

              <subsystem xmlns="urn:jboss:domain:logging:1.1">

                  <console-handler name="CONSOLE" autoflush="true">

                      <level name="INFO"/>

                      <formatter>

                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                      </formatter>

                  </console-handler>

                  <periodic-rotating-file-handler name="FILE" autoflush="true">

                      <level name="INFO"/>

                      <formatter>

                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                      </formatter>

                      <file relative-to="jboss.server.log.dir" path="C:\****\server.log"/>

                      <suffix value=".yyyy-MM-dd-HH"/>

                      <append value="true"/>

                  </periodic-rotating-file-handler>

                  <periodic-rotating-file-handler name="HIBERNATE" autoflush="true">

                      <level name="TRACE"/>

                      <formatter>

                          <pattern-formatter pattern="%d{dd MMM yyy HH:mm:ss} %-5p %m%n"/>

                      </formatter>

                      <file relative-to="jboss.server.log.dir" path="C:\****\*****\******\hibernate.log"/>

                      <suffix value=".yyyy-MM-dd-HH"/>

                      <append value="true"/>

                  </periodic-rotating-file-handler>

                  <logger category="com.arjuna">

                      <level name="WARN"/>

                  </logger>

                  <logger category="org.apache.tomcat.util.modeler">

                      <level name="WARN"/>

                  </logger>

                  <logger category="sun.rmi">

                      <level name="WARN"/>

                  </logger>

                  <logger category="org.hibernate.SQL">

                      <level name="ERROR"/>

                      <handlers>

                          <handler name="HIBERNATE"/>

                      </handlers>

                  </logger>

                  <logger category="org.hibernate.type">

                      <level name="ERROR"/>

                      <handlers>

                          <handler name="HIBERNATE"/>

                      </handlers>

                  </logger>

                  <logger category="org.springframework.security.ldap">

                      <level name="INFO"/>

                      <handlers>

                          <handler name="CONSOLE"/>

                      </handlers>

                  </logger>

                  <root-logger>

                      <level name="INFO"/>

                      <handlers>

                          <handler name="CONSOLE"/>

                          <handler name="FILE"/>

                      </handlers>

                  </root-logger>

              </subsystem>

       

       

      We want to configure standalone.log to server.log ?? can someone help us on this