Whenever log4j APIs are used for logging, you should place log4j.xml or 
log4j.properties in your classpath. Now, if you have server side application in 
jboss, then there is already a log4j.xml in conf directory. In case you have a 
client application which uses log4j API, then you will have to place the 
log4j.xml or log4j.properties in your client classpath. These files will be 
used for finding appropriate appenders for a logger.

anonymous wrote : but it would be helpful if the distro contained such a 
default file for client use
This file is application specific, so the distribution cannot contain this file.

Sample contents of log4j.xml:

<?xml version="1.0" encoding="UTF-8" ?>
  | <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  | 
  | <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
  | 
  |     <appender name="myAppender"
  |               class="org.apache.log4j.FileAppender">
  |         <layout class="org.apache.log4j.SimpleLayout"/>
  |     </appender>
  | 
  |     <root>
  |         <priority value="debug" />
  |         <appender-ref ref="myAppender"/>
  |     </root>
  | 
  | </log4j:configuration>

Sample log4j.properties:

# The root logger is assigned priority level DEBUG and an appender
  | # named myAppender.
  | log4j.rootLogger=debug, myAppender
  | 
  | # The appender's type specified as FileAppender, i.e. log output
  | # written to a file.
  | log4j.appender.myAppender=org.apache.log4j.FileAppender
  | 
  | # The appender is assigned a layout SimpleLayout.
  | # SimpleLayout will include only priority level of the log
  | # statement and the log statement itself in log output.
  | log4j.appender.myAppender.layout=org.apache.log4j.SimpleLayout

Have a look at :
http://www.developer.com/open/article.php/10930_3097221_3 for the same





View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3905631#3905631

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3905631


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to