9 Replies Latest reply on Feb 3, 2016 1:45 AM by andreas_w

    Logging - Problem

    andreas_w

      Hi, we are using WildFly 9.0.1 and have a "strange" logging problem. We have several servers, all running with the same WildFly configuration. But on one server we can't see some log messages from one of our java class. On the other servers they are shown without any problem. As I said the configuration of WildFly is the same. We compared the version of java too. Anyone has an idea what could be the problem? Or we configured something wrong? As I said the it is working on all other servers but not on this. And the configuration is coming from an git-repository. So it is the same. This is our logging-configuration. The problem is in the package com.sub.sub1.subsub.subsubsub. We tried to set it here the logger explicit to all but it should be already handled from com.sub.sub1. Thanks in advance

       

      Logging-configuration

      <subsystem xmlns="urn:jboss:domain:logging:3.0">
                  <console-handler name="CONSOLE">
                      <level name="ALL"/>
                      <formatter>
                          <named-formatter name="COLOR-PATTERN"/>
                      </formatter>
                  </console-handler>
                  <periodic-rotating-file-handler name="FILE" autoflush="true">
                      <level name="ALL"/>
                      <formatter>
                          <named-formatter name="PATTERN"/>
                      </formatter>
                      <file relative-to="jboss.server.log.dir" path="server.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="org.jboss.as.config">
                      <level name="DEBUG"/>
                  </logger>
                  <logger category="sun.rmi">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb.config">
                      <level name="ERROR"/>
                  </logger>
                  <logger category="com.sub.sub1">
                      <level name="ALL"/>
                  </logger>
                  <logger category="com.sub.sub2">
                      <level name="ALL"/>
                  </logger>
                  <logger category="com.sub.sub3">
                      <level name="WARN"/>
                  </logger>
                  <logger category="com.sub.sub1.subsub.subsubsub">
                      <level name="ALL"/>
                  </logger>
                  <logger category="com.sub" >
                      <level name="ALL"/>
                  </logger>
        <root-logger>
                      <level name="INFO"/>
                      <handlers>
                          <handler name="CONSOLE"/>
                          <handler name="FILE"/>
                      </handlers>
                  </root-logger>
                  <formatter name="PATTERN">
                      <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
                  </formatter>
                  <formatter name="COLOR-PATTERN">
                      <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
                  </formatter>
              </subsystem>
      
      
      
        • 1. Re: Logging - Problem
          jamezp

          What is the actual problem you're seeing? Is the com.sub.sub1.subsub.subsubsub not logging anything until you have it defined?

           

          --

          James R. Perkins

          • 2. Re: Logging - Problem
            andreas_w

            The problem is that it is not logging anything even if we defined it as described. But we made some progress here. After changing something in the logging via die management console and deleting this entry afterwards manually from the standalone.xml logging is working now as expected. We will try to reproduce this again.

            • 3. Re: Logging - Problem
              goggelz

              Hello Andreas.

              I am using the jboss-common-logging-log4j-2.0.4.GA.jar as the Logger class.

              Then you should be able to use a specific Logger with Logger.getLogger("category").debug("debug message");

              When "com.sub.sub1.subsub.subsubsub" will hit the logger "com.sub", there you explicitly say, that you don't want to use the parent-handlers.

              In that case, there is no handler described where the logs have to be outputted.

              Please correct me if I am wrong.

              Best Regards,

              Tobi

              • 4. Re: Logging - Problem
                andreas_w

                Hello, Tobi, thanks for your answer. But I guess that this isn't the problem. I copied the wrong configuration to you. This "use parent-handlers=false" isn't in our original configuration. Now I changed this in the configuration above. Sorry for the mistake. best regards Andreas

                • 5. Re: Logging - Problem
                  andreas_w

                  We had recently another problem with logging. After a restart of WildFly some messages weren't logged in the logfile anymore. But before the restart I could see them. Has anyone an idea what could be the problem? Between the restart the configuration wasn't changed.

                  • 6. Re: Logging - Problem
                    jamezp

                    Only thing I can think of is if the XML file was changed while the server was running.

                     

                    --

                    James R. Perkins

                    • 7. Re: Logging - Problem
                      andreas_w

                      thanks for your answer. But we didn't changed anything. Just restarted the server.

                      • 8. Re: Logging - Problem
                        jamezp

                        What types of log messages seem to not be getting logged anymore? Are they messages from your application or server messages?

                         

                        --

                        James R. Perkins

                        • 9. Re: Logging - Problem
                          andreas_w

                          The messages are from our application. We saw already the behaviour that in the same class messages were logged and then a few lines later the log-messages were not logged anymore. Bot log-messages had the same log-level.