At 07:39 PM 1/3/2005, Curt Arnold wrote:

On Jan 3, 2005, at 11:49 AM, Yoav Shapira wrote:

Hi,
I don't think it's a bad idea, but could there be a more specific or
domain-related name for it?  Component(Base) is very generic, whereas
Appender(Skeleton) is more logging-domain-specific.

Yoav

--- Ceki Gülcü <[EMAIL PROTECTED]> wrote:

The only method on o.a.l.spi.Component is setLoggerRepository. I assume the motivation is to inform "components" of which LoggerRepository they belong after their construction. I haven't looked at the problem. but my preference would be to modify the respective constructors to take either a LoggerRepository (assuming that it would be known at construction time) or something like a LoggerRepositoryLocator which could be used to locate the repository at a later time. Changing the constructors would force propagation of the LoggerRepository. The setLoggerRepository approach leaves the potential to forget to set the repository.

You are 100% right to note that LoggerRepository can be left unset. However, leaving the LoggerRepository unset is synonymous with a programming error. In the absence of bugs in log4j configurators, the LoggerRepository will be correctly set for all components generated during the configuration phase. If custom extensions (built outside the Apache Logging Services) forget to set the LoggerRepository, then the CustomerBase implementation defaults to using a o.a.ugli.impl.SimpleLoggerFA instance instead of the "correct" LoggerRepository.

Most importantly, it is not possible to impose a constructor on an
interface and log4j source code assumes interfaces, not classes. For
example, the code is developed in terms of the Appender interface not
AppenderSkeleton.


Could you describe the items that should be aware of the LoggerRepository?

Basically, all components that may generate log4j *internal* log messages must be aware of their owning LoggerRepository.



--
Ceki Gülcü

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



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



Reply via email to