logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Kriger" <akri...@triene.com>
Subject log4j and Weblogic question
Date Thu, 25 Jan 2001 02:44:12 GMT
I've run into an situation I don't quite understand using log4j. 

On my project we create several proxies on Weblogic Server at startup (for
ease of reference, call it FooProxy). Each one has a startup method called
by the Server and is loaded during the Server intialization. I have a class
LogWrapper that defines methods which wrap log4j methods ( using
LogWrapper.getInstance().log(...) ). The constructor for LogWrapper
initalizes a PropertyConfigurator. 

If I do not call LogWrapper's ctor in the startup method of FooProxy, then
future calls to LogWrapper.getInstance().log(...) cause a
NullPointerException and FooProxy fails to load properly. If I do call
LogWrapper's ctor, then FooProxy loads properly.

I can make calls to LogWrapper.getInstance().log(...) in other classes
without problem (i.e. no call to the ctor is necessary). It's just this
startup method that causes the problems.

Because I am new to log4j, I do not have a clear understanding of how the
PropertyConfigurator loads, where this information is managed, and how the
Categories reference it. Perhaps somebody could shed some light on this
mystery for me.

On a related but separate note, is a call to Category.getInstance() creating
a new Category object or is there an object store somewhere that recycles
Category objects?

And finally, on an distant note, is there a way of knowing if
PropertyConfigurator loaded correctly? If PropertyConfigurator tries to load
a file and fails, will a BasicConfigurator automatically load?


Andy Kriger

View raw message