4 Replies Latest reply on Jun 29, 2015 10:58 AM by raghunadh.mogilisetti

    logging configuration used in standalone.xml is not working

    jagannath793

      Hi,

      We are using JBoss as.7.1 server and trying to use jboss logging subsystem by using standalone.xml . The requirement is to set different log level in production without restarting the server . I have removed all log4j dependency i.e log4j.properties and log4j jar files from WAR file used in deployment.I am still not seeing any log information printing in file myPage.log. I have already followed many blog. I think,I should not modify anything default log4j.properties placed in server. Thanks advance for your kindly help. your speedy response will be really helpful.

      Here is standalone.xml

      <?xml version='1.0' encoding='UTF-8'?>

      <server xmlns="urn:jboss:domain:1.2">

          <extensions>

              <extension module="org.jboss.as.clustering.infinispan"/>

              <extension module="org.jboss.as.configadmin"/>

              <extension module="org.jboss.as.connector"/>

              <extension module="org.jboss.as.deployment-scanner"/>

              <extension module="org.jboss.as.ee"/>

              <extension module="org.jboss.as.ejb3"/>

              <extension module="org.jboss.as.jdr"/>

              <extension module="org.jboss.as.jmx"/>

              <extension module="org.jboss.as.jpa"/>

              <extension module="org.jboss.as.logging"/>

              <extension module="org.jboss.as.mail"/>

              <extension module="org.jboss.as.naming"/>

              <extension module="org.jboss.as.osgi"/>

              <extension module="org.jboss.as.pojo"/>

              <extension module="org.jboss.as.remoting"/>

              <extension module="org.jboss.as.sar"/>

              <extension module="org.jboss.as.security"/>

              <extension module="org.jboss.as.threads"/>

              <extension module="org.jboss.as.transactions"/>

              <extension module="org.jboss.as.web"/>

              <extension module="org.jboss.as.webservices"/>

              <extension module="org.jboss.as.weld"/>

          </extensions>

       

          <management>

              <security-realms>

                  <security-realm name="ManagementRealm">

                      <authentication>

                          <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>

                      </authentication>

                  </security-realm>

                  <security-realm name="ApplicationRealm">

                      <authentication>

                          <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>

                      </authentication>

                  </security-realm>

              </security-realms>

              <management-interfaces>

                  <native-interface security-realm="ManagementRealm">

                      <socket-binding native="management-native"/>

                  </native-interface>

                  <http-interface security-realm="ManagementRealm">

                      <socket-binding http="management-http"/>

                  </http-interface>

              </management-interfaces>

          </management>

       

          <profile>

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

                  <console-handler name="CONSOLE">

                      <level name="INFO"/>

                      <formatter>

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

                      </formatter>

                  </console-handler>

                  <file-handler name="jaglog" autoflush="false">

                      <level name="WARNING"/>

                      <file relative-to="jboss.server.log.dir" path="server.log"/>

                      <append value="false"/>

                  </file-handler>

                  <file-handler name="JagaPagelog" autoflush="false">

                      <level name="DEBUG"/>

                      <file relative-to="jboss.server.log.dir" path="myPage.log"/>

                      <append value="false"/>

                  </file-handler>

                  <file-handler name="JagaPageServicesLog" autoflush="false">

                      <level name="WARN"/>

                      <file relative-to="jboss.server.log.dir" path="myPageServices.log"/>

                      <append value="false"/>

                  </file-handler>

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

                      <level name="DEBUG"/>

                      <formatter>

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

                      </formatter>

                      <file relative-to="jboss.server.log.dir" path="myPage.log"/>

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

                      <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="jacorb">

                      <level name="WARN"/>

                  </logger>

                  <logger category="com.apple.ist.hr.mypage.web" use-parent-handlers="true">

                      <level name="INFO"/>

                  </logger>

                  <root-logger>

                      <level name="INFO"/>

                      <handlers>

                          <handler name="CONSOLE"/>

                          <handler name="FILE"/>

                      </handlers>

                  </root-logger>

              </subsystem>

             

       

      </server>

        • 1. Re: logging configuration used in standalone.xml is not working
          wdfink

          If you change the logging level with the management console (jboss-cli.sh) this take effect during runtime.

          • 2. Re: logging configuration used in standalone.xml is not working
            jagannath793

            Hi,

             

            Thanks for your kindly reply. There are two issues .

            1.  I have different war file in my ear . Also have separate name of the log file in each war to log the message. I would like to

            set different log level based on package in each war. like log4j.properties which I removed from deployment to try through JBoss 7.1 admin console. I am not still sure how to achieve this . I was trying to modify standalone.xml as mentioned above but unable to see the changes reflect in log files even after restart the server.

            2.The log level changes should reflect dynamically without restart the server.  I was trying to use Web Console: http://<host>:9990/console and then profile->Core->Logging to perform this changes.

             

            Thanks

            Regards

            Jagannath

            • 3. Re: logging configuration used in standalone.xml is not working
              sony.sharma

              Hi Jagannath,

               

              I am also facing the same issue. Please reply if you have solved this problem.

              • 4. Re: logging configuration used in standalone.xml is not working
                raghunadh.mogilisetti

                You might be missing the following piece code in your standalone.xml. Just check it once...

                 

                <system-properties>

                        <property name="nwf.internal.splunkConfigLocation" value="D:\\NWFLogs\\nwf-splunk-log4j.xml"/>

                        <property name="nwf.internal.splunkLogLocation" value="D:\\NWFLogs\\"/>

                        <property name="nwf.internal.platform" value="NWF"/>

                        <property name="org.jboss.as.logging.per-deployment" value="false"/>

                    </system-properties>