T Master,

Interesting point. I think what you are asking is whether appenders
having the same name should be treated as equal and treated as such. In 
particular, whether when adding an appender, the new appender replaces a 
previously added appender with the same name.

I think that would be a clean coherent policy, easy to implement using a 
Hasttable. What do you think? Did I correctly rephrase your question? 

Regards, Ceki

ps: Is T Master your real name?

At 14:57 09.01.2002 -0700, T Master wrote:
>Ceki,
>
>I've been looking at the code for adding an Appender.
>
>1.  In Log4J config files (i use properties), appenders must have a _unique_
>name as I understand it.
>
>2.  In Log4J system, appenders are _not_ required to have a name for
>instantiation - the name is null by default.
>
>3.  I've noticed in
>org.apache.log4j.helpers.AppenderAttachableImpl.addAppender(Appender
>newAppender) the code:
>   //@since version 0.9.1
>    if(!appenderList.contains(newAppender))
>      appenderList.addElement(newAppender);
>
>   This will check if the Vector appenderList has the same Appender by
>equality ( the equals() is used).
>   However, neither AppenderSkeleton, or WriterAppender or FileAppender  or
>RollingFileAppender
>(the object i was using) implements the equals() method.
>
>  In my opinion, each and every non-abstract Appender should implement
>public boolean equals().
>  The following should be tested for equality:
>     - object reference, null, then the appender's name.
>
>
>   I could be talking absolute rubbish, but I noticed one of my Category
>objects had two RollingFileAppenders with the same name in it,
> produced from the following code:
>    CODE:
>          Enumeration enum = category.getAllAppenders();
>          while (enum.hasMoreElements())
>          {
>               Appender appender = (Appender) enum.nextElement();
>               System.out.println("category has -" + appender.getName()
>+".");
>           }
>    OUTPUT:
>        category has -FILE_DEST.
>        category has -FILE_DEST.
>
>Forgive me for babbling, or being mistaken.
>
>
>T Master
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
Ceki Gülcü - http://qos.ch



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

Reply via email to