logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Diehl Martin, Köln" <martin.di...@fja.com>
Subject RE: Category Hirarchy.
Date Tue, 11 Sep 2001 06:41:17 GMT
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:Jiji_Sadasivakurup@tvratings.com]
> 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: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org

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


Mime
View raw message