-
1. Re: Per-deployment logging in EAP 6.1.0.GA: no console output
jamezp Jun 21, 2013 1:17 PM (in response to fabioo)There is a bug in the log4j-jboss-logmanager which bridges log4j to JBoss Log Manager. The bug is fixed in the upstream source, but a release hasn't been made yet.
If you're only using the ConsoleAppender and RollingFileAppender you could use a logging.properties formatted for the JBoss Log Manager. It would look something like the following:
# Additional loggers to configure (the root logger is always configured) loggers= logger.level=INFO logger.handlers=CONSOLE,FILE handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler handler.CONSOLE.level=INFO handler.CONSOLE.formatter=CONSOLE handler.CONSOLE.properties=autoFlush,target handler.CONSOLE.autoFlush=true handler.CONSOLE.target=SYSTEM_OUT handler.FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler handler.FILE.level=ALL handler.FILE.formatter=FILE handler.FILE.properties=autoFlush,append,fileName,suffix handler.FILE.constructorProperties=fileName,append handler.FILE.autoFlush=true handler.FILE.append=true handler.FILE.fileName=${jboss.server.log.dir}/deployment.log handler.FILE.suffix=.yyyy-MM-dd formatter.CONSOLE=org.jboss.logmanager.formatters.PatternFormatter formatter.CONSOLE.properties=pattern formatter.CONSOLE.pattern=%K{level}%d{HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%E%n formatter.FILE=org.jboss.logmanager.formatters.PatternFormatter formatter.FILE.properties=pattern formatter.FILE.constructorProperties=pattern formatter.FILE.pattern=%d{HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%E%n
--
James R. Perkins
-
2. Re: Per-deployment logging in EAP 6.1.0.GA: no console output
fabioo Jun 25, 2013 5:45 AM (in response to jamezp)Ok, thanks for the explanation, your example has been really useful. Just a small note: there's an extra whitespace at the end of the line
handler.CONSOLE.target=SYSTEM_OUT
which raises a "No enum constant org.jboss.logmanager.handlers.ConsoleHandler.Target.SYSTEM_OUT" exception (just in case someone else copies/pastes it!)
Fabio
-
3. Re: Per-deployment logging in EAP 6.1.0.GA: no console output
jamezp Jun 26, 2013 12:15 PM (in response to fabioo)Nice catch, thanks! I've created a JIRA for the logmanager to fix that. It's a bug that it's not trimming the property string values.
--
James R. Perkins
-
4. Re: Per-deployment logging in EAP 6.1.0.GA: no console output
windigo Sep 23, 2014 5:34 AM (in response to jamezp)Hi,
is the console-bug in the log4j-jboss-logmanager already fixed? I can't fnd a jira-issue for that.
I'm also trying to configure a log4j.properties with multiple file-appenders and additivity-flags. Is this also possible in a logging.properties-file?
thx in advance
Felix