You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by tom ONeill <be...@hotmail.com> on 2003/12/01 12:56:48 UTC

Unexpected logger ancestor

Hi all,

I am using log4j 1.2.8 which I have congifured using the XML configuration. 
I have defined four category entires in my log file and I have now 
encountered some unexpected (for me at least) behaviour.

The loggers are configured as follows:

<category name="X" >
   <priority value="debug" />
</category>

<category name="Y" >
   <priority value="debug" />
</category>

<category name="X.Z" >
   <priority value="debug" />
</category>

<category name="Y.Z" >
   <priority value="debug" />
</category>

<root>
   <priority value="INFO"/>
   <appender-ref ref="MyFile"/>
</root>


I have turned the log4j debug output on and it seems that the X and Y  and 
X.Z categories are being created correctly. However according to the debug 
output the Y.Z logger is not being created as Y.Z but as X.Y.Z.

I can only guess that because X is defined as the parent logger of Z in 
Category X.Z that log4j is automatically expanding the Y.Z to X.Z because it 
already thinks that X is an ancestor of X.

Is this the way log4j works and if so why? Can I not define my loggers using 
the names I have defined above?

Tom

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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


Re: Unexpected logger ancestor

Posted by Ceki Gülcü <ce...@qos.ch>.
Tom,

Have you made any attempt to read the documentation?

At 11:56 AM 12/1/2003 +0000, tom ONeill wrote:
>Hi all,
>
>I am using log4j 1.2.8 which I have congifured using the XML 
>configuration. I have defined four category entires in my log file and I 
>have now encountered some unexpected (for me at least) behaviour.
>
>The loggers are configured as follows:
>
><category name="X" >
>   <priority value="debug" />
></category>
>
><category name="Y" >
>   <priority value="debug" />
></category>

[cut]


>Tom

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



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