logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <...@qos.ch>
Subject Re: Request
Date Thu, 19 Apr 2001 08:33:57 GMT
At 09:06 18.04.2001 +0200, ChassandeBarrioz Sebastien wrote:
>        I represent a younger open source community ( www.objectweb.org). We
>would llike choose a logging product for all objectweb project. Log4j is very
>interesting, but i would suggest to add a simple functionality. When you write
>a program with logs, the name of the category is usually the package name or
>the class name. But when many components are assembled, it's impossible to
>specify a priority for the component group. I would like give the possibility to
>add many names to a category with multiple heritage of priority and appender.
>Rules :
>I suppose 
>        P1, P2, C1 are instance of Category class
>with    P1 = father of C1
>        P2 = father of C1
>The rules to compose are : 
>        C1.priority = max( P1.priority, P2.priority )
>        C1.appenders = P1.appenders + P2.appenders
>Example :
>P1 = Category.getInstance("aaa.bbb")
>P2 = Category.getInstance("zzz.yyy")
>C1 = Category.getInstance("aaa.bbb.ccc")
>=> The C1 Category herits of priority of P1 and P2
>=> The C1 Category herits of appender of P1 and P2
>Is this problem already studied by a log4j developper ?

This is something that the first ancestor of log4j, then used in E.U. Semper project, had.
It turned out that no one used this feature. Having said that I personally think that the
suggestion is extremely interesting. I also like the addName() method. There are multiple
issues with multiple inheritance:

1) Why choose the C1.priority = max( P1.priority, P2.priority) instead of 
   C1.priority = min( P1.priority, P2.priority). The latter will generate more verbose output
whereas the former will     tend hush up things. What made you choose the max rule instead
of the min rule for the priority inheritance? 

2) There are serious synchronization issues involved. More importantly the hierarchy walk
will increase linearly with the number of parents. Moreover, since the number of parents is
not known in advance they have to be stored in a vector which will increase walk time significantly
even if there is a single parent. This can be alleviated if do not store the first parent
in a vector but as a separate field.

3) The rules of the game become increasingly complicated. This will make it harder for people
to learn and use log4j.

Otherwise, as I said, the suggestion is very interesting. I also appreciate the clear presentation
of your idea. Best regards, Ceki 

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

View raw message