-
1. Re: Seam and Logging
niox.nikospara.yahoo.com Jul 21, 2009 4:49 PM (in response to israel.bgf)Hello,
If you are using JBoss the jboss-log4j.xml, which configures Log4J globally in JBoss, can be found under $JBOSS_HOME/server/default/conf. (Replace default with the configuration you are using.)
-
2. Re: Seam and Logging
israel.bgf Jul 21, 2009 6:08 PM (in response to israel.bgf)hmm, thks and is it possible to make an application specific configuration? Not a globally one?
Israel
-
3. Re: Seam and Logging
niox.nikospara.yahoo.com Jul 21, 2009 6:54 PM (in response to israel.bgf)Yes, you can use an application-level setup for a logging infrastructure. I haven't tried it, but for Log4J you probably should: (1) Include the necessary jars (2) write your own log4j.xml/log4j.properties and place it in the root of the classpath of the application (3) make sure that your application classloaders are parent last, so your internal log4j classes are visible (this has to do with configuration; if the global log4j is loaded, then I presume that the global config will be used, effectively ignoring yours). I stress again the fact that I haven't tried this method.
However, JBoss checks jboss-log4j.xml for changes every few seconds. So app-specific configuration can be written there, and modified at runtime at will. I use something like the following (only related sections shown):
<!-- my own appender, writes to app.log --> <appender name="APP" class="org.jboss.logging.appender.RollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="File" value="${jboss.server.log.dir}/app.log"/> ... </appender> ... <!-- direct log entries from org.nikos.myapp.** to the APP appender --> <category name="org.nikos.myapp"> <priority value="DEBUG" /> <appender-ref ref="APP"/> </category>
The appender definition is a one-time procedure. The rest is very easy, and configured per app.
-
4. Re: Seam and Logging
asookazian Jul 22, 2009 6:58 AM (in response to israel.bgf)Buy and read Jboss in Action.
relevant excerpt:
<log4j:...> ... <appender name="JBIA" ...> ... <param name="File" value="${jboss.server.log.dir}/jbia.log"/> ... </appender> ... <category name="org.jbia"> <priority value="DEBUG"/> <appender-ref ref="JBIA" /> </category> </log4j>
Although I didn't believe it until I verified it in JBoss 5.1.0.GA (I always thought that only *-ds.xml and WAR/EAR files are hot deployable only in server/foo/deploy directory, not the server/foo/conf directory), the following statement is true:
JBoss checks jboss-log4j.xml for changes every few seconds