Hi Ceki,

I have been using log4j for a while now and I have read the documentation on numerous occasions. I posted my question because the behaviour I experienced was not consistent with what I had expected based on my intepretation of the documentation (warrented that my interpretation may not have been correct).

The documentation states that
"the name of a logger is a case sensitive string of dot seperated words and each word in a logger name is said to be an ancestor of the subsequent words and a parent of the immediately following word."


"A logger is said to be an ancestor of another logger if its name followed by a dot is a prefix of the descendant logger name. A logger is said to be a parent of a child logger if there are no ancestors between itself and the descendant logger. "

From this I can take it that if I create a logger "X" and then create
another logger "X.Z" then the logger X is an ancestor of Z. If as I outlined in my original question I create a logger "Y" and then a logger "Y.Z" then the logger "Y.Z" is actually created as "X.Y.Z". I interpreted the line "A logger is said to be an ancestor of another logger if its name followed by a dot is a prefix of the descendant logger name"to mean that the a logger can only be an ancestor of another logger if its name follows by a dot is the immediate prefix of the decendant logger name. Thus just because I had originally created a logger X.Z I would not expected Y.Z to end up as "X.Y.Z" because "X" followed by a dot is not a prefix of the logger name "Y.Z".

However I can now see that by creating a logger "X" and a logger "X.Z" I have said that "X" is an ancestor of "Z" and I suppose log4j holds this relationship when I create the logger "Y.Z".

Tom


From: Ceki Gülcü <[EMAIL PROTECTED]>
Reply-To: "Log4J Users List" <[EMAIL PROTECTED]>
To: "Log4J Users List" <[EMAIL PROTECTED]>
Subject: Re: Unexpected logger ancestor
Date: Fri, 05 Dec 2003 19:54:36 +0100

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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



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



Reply via email to