3 Replies Latest reply on Mar 29, 2011 12:30 PM by David Lloyd

    JBAS-9149, Disappearing log messages

    Scott Stark Master

      This issue is coming up frequently of testing non-standard configurations of the server since the errors are tending to happen early on, so it is something I need fixed. I looked at the RootLoggerService and followed the logging down to the LoggerNode.publish(ExtLogRecord) to get a quick idea of what the path from the log messaes to the handlers is.


      What if the LoggerNode.clearHandlers() accepts a List<LogRecord> and this is populated with all log msgs that attempt to be published while the handlers are being cleared, and then the RootLoggerService republishes these to the server.log. I'm thinking that duplicates between the logs are ok if it simplifies how this is done. Right now I really don't know all that is involved to capture these msgs, so I'll start along this approach. If it is the wrong way to go, chime in!



        • 1. JBAS-9149, Disappearing log messages
          Scott Stark Master

          An alternative would be to have the RootLoggerService only remove the bootstrap handlers once it has been notified that the non-bootstrap handlers have ben added. This would result in duplicate log msgs going to the bootstrap log during the period the bootstrap handlers are being removed, but it should be simple and the duplicates not a problem relative to losing messages.

          • 2. JBAS-9149, Disappearing log messages
            Scott Stark Master

            anecdotally, this could be related to the reseting of the logger priorities as the switch between the logging.properties and standalone.xml configurations happens because even when I comment out the clearing of the boot.log handlers in the RootLoggerService, it still seems like I fail to see some of the messages from the NetworkInterfaceService. I'm not sure the levels were configured consistently everytime I appeared to see this which is why it is just anecdotal at this point.


            • 3. JBAS-9149, Disappearing log messages
              David Lloyd Master

              The approach I'd really like to use is to persist log configuration between boots (via serialization or something).  This way the boot logger config is only used the first time you boot.  Then subsequent boots would just apply the delta of the old config to the new config (which would normally be 0) during a regular boot.  This way the server boots up with a regular log configuration.


              Granted this would be a bit of a pain to implement since the LogManager currently does not have the notion of a persistent configuration, and the diff logic won't be trivial.  That's why I have put it off.