Dear Rickard,


It is a great honor to see your posts on this mailing list.

Having said that and I'd hate to be a dimwit, but why are attempts to find the *BeanInfo classes of any consequence? It is a "small" cost which is incurred only once.

One solution would be to create a new class, say X, which contains a static method, say overrideDefaultConfig returning a boolean. The static class loader of the o.a.log4j.LogManager class (which is loaded before any logging goes through) can be modified to call X.overrideDefaultConfig to check whether default configuration should be attempted not.

Regards,

At 11:32 AM 6/4/2003 +0200, Rickard Öberg wrote:
Rickard Öberg wrote:
Preferably, what I'd want to do is:
1) get the default override as described in the manual to work
2) do manual programmatic configuration
2) I can do, but I'm not sure why 1) isn't working.

The reason 1) didn't work was because log4j was not signed. Therefore it could not read the system property, and hence went ahead with the default initialization procedure.


So, in order to get minimal number of connections with log4j in applets you need to do the following:
1) Sign the applet. This is necessary in order to set the system property
2) Add a static block in the applet class which sets the system property "log4j.defaultInitOverride" to "true", and configures log4j manually. File-based configuration is no good, since it results in attempts to load *BeanInfo classes due to the introspection mechanism used
3) Sign log4j.jar


After that it works great!

As you can see, a lot of the above would be simplified if there was another way to override the default initialization procedure besides using a system property. Using system properties in an applet is generally impossible unless you sign the jars.

/Rickard

--
Ceki For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp



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



Reply via email to