Am Freitag, 21. November 2003 15:34 schrieb 
[EMAIL PROTECTED]:

> easy pizzy...We are already having the same scenario.
> Don't use the default log4j initialization(which means just putting
> the log4j.properties file in the class path and forget about it.)This
> way you have no control over the initialization. You write a
> class(e.g. LogEnvLoader) and in that class load the property file(Or
> XMl file if you want) and initialize the log4j environment. And then
> you can call this initialization class form either the init method of
> servlet or from any model layer class.

Just one addition: I would recommend not to use log4j directly,
but via the commons.logging wrapper (it's really easy and IMHO
less intrusive, plus you're not limited to the log4j framework that
way). Then, considering the classpath issue, it makes no difference 
whether you're dealing with a web or conventional application.
The only thing you have to make sure is that the configuration
files are being found, i.e. reside inside the classpath. Neither
the classpath concept nor Log4j are web-specific in any way.

> HTH.
> regards,
> Shirish.

-- Chris.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to