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.

HTH.
regards,
Shirish.

-----Original Message-----
From: Todor Sergueev Petkov [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 3:29 PM
To: Struts Users Mailing List
Subject: STRUTS LOG4J


Hi everybody... I know that one of the ways to use log4j with struts is 
to load a log4j.properties file at servlet container startup...
But what if I have a business layer that has no direct connection to a 
"servlet container" or I want to run some stand-alone tests and 
logging... Do I have to have two separate ways of loading the 
log4j.properties file or is there a way to do it so it works in servlet 
container and stand-alone environment?!

Thanks a lot,
Todor


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


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

Reply via email to