Hi,
>personal tasks), so I set the following system property :
>
> -Dlog4j.configuratorClass=mypackage.MyConfigurator
This system property will then be set for all the webapps, as they all
share the same JVM instance.
>Please note I can use a Servlet.init() to configure Log4J because
>some librairies (Hibernate) use log4j to display infos before any
>servlet is initialized by Tomcat.
You mean you can NOT use a Servlet#init method, right? Use a
ServletContextListener instead of a Servlet#init method. This will get
called before any of your libraries are initialized. In that listener's
contextInitialized method, do
System.setProperty("log4j.configuratorClass",
"mypackage.MyConfigurator");
// Configure log4j
System.setProperty("log4j.configuratorClass", null);
And take the -Dlog4j.configuratorClass out of your java launch options:
only do it dynamically as shown above, and then undo it so other webapps
are not affected.
This is a bit kludgey, as it relies on the fact webapps in tomcat are
initialized in series rather than in parallel. But I don't see a method
like LogManager#configure(Configurator x, ...) in log4j.
Yoav Shapira
This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged. This
e-mail is intended only for the individual(s) to whom it is addressed, and may not be
saved, copied, printed, disclosed or used by anyone else. If you are not the(an)
intended recipient, please immediately delete this e-mail from your computer system
and notify the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]