1) Configuring
log4.properties should go into Web-Inf/classes.
It means that if you are using eclipse or
ant you have to make sure that
it goes there after you compile the classes.
In eclipse: Put log4j.properties in src. If you are using WTP or
MyEclipse or something like it log4j.properties gets copied into Web-Inf/classes after eclipse builds your web project.
2) Using
Put the log4j**.jar in Web-Inf/lib
Make sure you don't put commons-logging in there!!!
After this you can just define a logger in each class the way it is
usually done:
public static final Logger
logger = Logger.gerLogger(this.getClass().getName());
In log4j.properties set the level for the root and al the other classes from which you need logging messages.
That should do it. At least it is the configuration we are using in our JSF project. And it works.
[ October 07, 2006: Message edited by: Nomunbilegt Batsukh ]
[ October 07, 2006: Message edited by: Nomunbilegt Batsukh ]