-
1. Re: AS 7.2.0.Final Log4j console logging
suikast42 Mar 15, 2013 9:21 AM (in response to suikast42)Sorry I typed enter before I was ready .
And as I can see this approch to configure log4j in custom way disturbs another libs as well.
14:16:36,071 INFO [stdout] (ServerService Thread Pool -- 172) 14:16:36,055 INFO [PrettyFilter] PrettyFilter starting up...
14:16:36,086 INFO [stdout] (ServerService Thread Pool -- 172) 14:16:36,086 INFO [PrettyFilter] PrettyFilter initialized.
14:16:36,086 INFO [solder-servlet] (ServerService Thread Pool -- 172) Catch Integration for Servlets enabled
-
2. Re: AS 7.2.0.Final Log4j console logging
jamezp Mar 15, 2013 5:45 PM (in response to suikast42)It's because the log4j ConsoleAppender writes to stdout which is captured by JBoss STDIO and then passed through a logger. Is there a reason you'd rather not use the logging subsystem? You can use log4j appenders as custom-handler's if there is a handler that's missing.
--
James R. Perkins
-
3. Re: AS 7.2.0.Final Log4j console logging
suikast42 Mar 16, 2013 7:44 AM (in response to jamezp)James Perkins schrieb:
It's because the log4j ConsoleAppender writes to stdout which is captured by JBoss STDIO and then passed through a logger.
Ok that behaviour is therefore normal.
James Perkins schrieb:
. Is there a reason you'd rather not use the logging subsystem? You can use log4j appenders as custom-handler's if there is a handler that's missing.
That was exactly the problem. So I can define my loggers and appenders in standalone.xml , right ? Can you povide me an example how can I use log4j appenders in logging subsystem ??
-
4. Re: AS 7.2.0.Final Log4j console logging
jamezp Mar 16, 2013 4:19 PM (in response to suikast42)Here's an example of using a file handler:
<subsystem xmlns="urn:jboss:domain:logging:1.2"> <custom-handler name="log4jAppender" class="org.apache.log4j.FileAppender" module="org.apache.log4j"> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> </formatter> <level name="INFO"/> <properties> <property name="append" value="true"/> <property name="file" value="${jboss.server.log.dir}/log4j.log"/> <property name="immediateFlush" value="true"/> </properties> </custom-handler> <root-logger> <level name="INFO"/> <handlers> <handler name="log4jAppender"/> </handlers> </root-logger> </subsystem>
--
James R. Perkins
-
5. Re: AS 7.2.0.Final Log4j console logging
suikast42 Mar 17, 2013 9:03 AM (in response to jamezp)Hi James,
thanks for that example. And what's about a custom log4j appender ? This appender is contained in my ear app.
-
6. Re: AS 7.2.0.Final Log4j console logging
jamezp Mar 17, 2013 7:23 PM (in response to suikast42)There isn't really a way to configure one based on an appender in your deployment. You'd have to use a separate JAR and set it up as a module.
--
James R. Perkins
-
7. Re: AS 7.2.0.Final Log4j console logging
suikast42 Mar 19, 2013 6:31 AM (in response to jamezp)James Perkins schrieb:
There isn't really a way to configure one based on an appender in your deployment. You'd have to use a separate JAR and set it up as a module.
--
James R. Perkins
I assume thats the same if I imlement a custom jboss appender ??
-
8. Re: AS 7.2.0.Final Log4j console logging
jamezp Mar 19, 2013 2:28 PM (in response to suikast42)Yeah. The module has to be seen when the logging subsystem boots up, which is well before any deployments happen.
--
James R. Perkins