logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject [NEWS] Component and ComponentBase
Date Fri, 07 Jan 2005 19:31:06 GMT

Curt et al.,

I had a long technical dicussion with a friend who mentioned that in
"Effective Java" Joshua Bloch makes a compelling case against the
setter approach (and in favor of constructors).

The existing configuration code relies on Appenders, Layouts and
Receivers having a default constructor. However, the Component
interface and ComponentBase class do *not* prevent the use of
constructors taking an LR as argument in other classes, in particular
in the classes indirectly instanciated by Appenders, Layouts, etc.

He also suggested a simple solution to the "default repository
configuration while in the context of 'myWebApp'" problem which
triggered all the recent changes. Basically, he suggests that in the
static initializer of LogManager the default repository be configured
before the repositorySelector is instantiated. During the
configuration of the default repository, the repositorySelector
field has to temporarily point to a default RepositorySelector, not
the real selector, not yet instantiated.

This fix may imply that we can go back to the old internal logging
guidelines which only required instance Logger variables, without the
need to change every single class that log4j used internally.

Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/

To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

View raw message