|
I have a grand total of about 18 hrs experience
with log4j, so put the following remarks in that context, but what you discuss
below doesn't put the power and flexibility to maximum use. Here is the
total of the statements needed in the EJB code:
import org.apache.log4j.Category;
public class OurBean implements
SessionBean
{ private final Category log = Category.getInstance(getClass().getName()); public void ourMethod()
{
log.info("ourMethod called");
}
}
Everything else you show below can be configured in
log4j.properties in the jboss/conf directory. That way, your logging code
is independent of its final format and destination. You can change the
format and destination without making a single change to your source
code.
To the original appender, log4j is already
installed. Just use the above statements in your source. Then
configure how you want your output to look and where you want it to go in
log4j.properties. The existing one will get you started. Finally,
you need to update jboss.conf to disable consolelogging and filelogging and
enable log4j. All the statements are already in the file, just
comment and uncomment. From trial and error, you can't comment by just
surrounding the block of statements with <!-- and -->. The
statements are executed anyway. You need to remove the starting
<.
Documentation for log4j can be found at http://www.apache.org/foundation/projects.html.
Look for log4j and follow the links.
|
Title: RE: [JBoss-user] log4j+JBoss
- [JBoss-user] log4j+JBoss Isidoro Fernandez Diaz
- RE: [JBoss-user] log4j+JBoss Jaime, Paul
- Re: [JBoss-user] log4j+JBoss Guy Rouillier
- Re: [JBoss-user] log4j+JBoss SRadford
- Re: [JBoss-user] log4j+JBoss Guy Rouillier
