4 Replies Latest reply on Sep 27, 2012 11:12 AM by clebert.suconic

    Per class logging / tracing

    clebert.suconic

      Isn't there a way we can get back to log/tracing at class levels?  I really used this feature when debugging before, and I would rather use System.outs than this logging... so... is there any way we can improve it?

       

       

      I'm a bit confused on how to configure logging on master anyways... I would like to disable everything.

       

       

      @Andy: can you gives some idea?

       

      I guess it would be nice to add it to the Readme

        • 1. Re: Per class logging / tracing
          ataylor

          so you cant do class level logging, you would have to add more loggers if you want finer grained logging.

           

          to configure logging you need the following:

           

          1) set the logging.configuration sys prop to point to a logging.properties

           

          2) set the log manager to jboss java.util.logging.manager=org.jboss.logmanager.LogManager

           

          the logging.properties needs the follwoing line, firstly configure the loggers you want

           

          loggers=org.jboss.logging,org.hornetq.core.server,org.hornetq.utils,org.hornetq.journal,org.hornetq.jms,org.hornetq.ra,org.hornetq.tests.unit,org.hornetq.tests.integration,org.hornetq.jms.tests

           

          note the root logger is always configured

           

          then set the level you want on each logger, so

           

          logger.org.hornetq.core.server.level=INFO

           

          then configure the handlers, so

           

          handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler

           

          # Console handler configuration

          handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler

          handler.CONSOLE.properties=autoFlush

          handler.CONSOLE.level=FINE

          handler.CONSOLE.autoFlush=true

          handler.CONSOLE.formatter=PATTERN

           

          # File handler configuration

          handler.FILE=org.jboss.logmanager.handlers.FileHandler

          handler.FILE.level=FINE

          handler.FILE.properties=autoFlush,fileName

          handler.FILE.autoFlush=true

          handler.FILE.fileName=hornetq.log

          handler.FILE.formatter=PATTERN

           

          # Formatter pattern configuration

          formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter

          formatter.PATTERN.properties=pattern

          formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] %s%E%n

           

          thats it really

          • 2. Re: Per class logging / tracing
            clebert.suconic

            I have talked to jamezp and smarlow on #jboss-as7.

             

             

            We should be doing Logger.getLogger for tracing level logging.

             

            We keep just package names and the way we are doing now...  but for tracing, we should get a separate Logger on the class and log to that class instead.

            • 3. Re: Per class logging / tracing
              ataylor

              that means we will have 2 loggers per class, seems wrong.

              • 4. Re: Per class logging / tracing
                clebert.suconic

                Well... the other Logger doesn't belong to the class... that means we will have either 0 (when only using the generic logger) or 1.

                 

                there are other projects doing it this way.