Qiqi,

The servlet side is pretty easy - as you likely already know. Use
Servlet.getServletConfig().getServletContext().getInitParameter("foo").
Then within the web-app config use <context-param foo='bar'/>. Then just
initialize the log4j system at runtime. In this way you can use a
different hierarchy for different virtual hosts. The problem here, of
course, is that this would likely have to done on every run because
servlet instances can be shared across web-apps and thus member
variables would be a bad place to stuff cached config info. I have never
tried it but this method should work although pretty inefficient.

John




Qiqi Dong wrote:

> I want to use log4j with Struts/Tomcat and like all servlets in a
> webapp to have same priority and log file. ALso, the priority and log
> file should be set and changed with servlet's initial parameters. Any
> idea from where should I start? Also, anyone has examples to use
> different hierarchy for multi virtual hosts?


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

Reply via email to