-
1. Re: Per class logging / tracing
ataylor Sep 26, 2012 10:55 AM (in response to clebert.suconic)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 Sep 26, 2012 5:18 PM (in response to ataylor)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 Sep 27, 2012 2:20 AM (in response to clebert.suconic)that means we will have 2 loggers per class, seems wrong.
-
4. Re: Per class logging / tracing
clebert.suconic Sep 27, 2012 11:12 AM (in response to ataylor)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.