Hi,

appenders are inherited additively from the category hierarchy. That means
exactly what you describe.
It is possible to override this default behavior so that appender
accumulation is no longer additive by setting the additivity flag to false.
See
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/Category.html#setA
dditivity(boolean)

(This was quoted from the 'Appenders and Layouts' section of 'Short
introduction to log4j' [http://jakarta.apache.org/log4j/docs/manual.html])

Bye,
        Martin.

> -----Original Message-----
> From: Sadasivakurup, Jiji L. [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, September 10, 2001 8:09 PM
> To:   'LOG4J Users Mailing List'
> Subject:      Category Hirarchy.
> 
> 
> I am new in LOG4J. I have a simple question. 
> 
> 
> I need to add two category com.test.reports, com.test.web and all the
> messages for those categories should be logged using those appenders and
> all
> the undefined categories should be logged using root category. How can I
> do
> that?  
> 
> Using the below config file what is happening is all the information are
> logged using root as well even if there are valid categories, SO the
> messages are logged in two appenders. Pl let me know what am I doing
> wrong. 
> 
> Thanks
> Jiji 
> 
> 
> 
> .....
> .....
> 
>       <category name="com.test.reports">
>         <priority value="DEBUG" />
>         <appender-ref ref="reports" />
>       </category>
> 
>       <category name="com.test.web">
>         <priority value="WARN" />
>         <appender-ref ref="web" />
>       </category>
> 
>       <root>
>          <priority value ="debug" />
>         <appender-ref ref="rootlog" />
>       </root>
> 
> </log4j:configuration>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to