At 16:25 18.10.2001 -0600, you wrote:
>Noone has responded to my previous email..
>
>Is this a bug?  My workaround is to set a default INFO priority always.

Do you think it's a bug? Come on, you are being lazy here, 
just read the source of the Category class. It will take you
20 seconds to realize your mistake. 

>----- Original Message -----
>From: "T Master" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, October 17, 2001 4:43 PM
>Subject: Null Priority obtained from Category. Bug?
>
>
>> Problem:  Obtain an instance of a Category (defined in file with level)
>with
>> a null Priority.
>>
>>
>> My config file (properties) contains:
>>     log4j.category.USER.Category1=INFO
>>
>> I obtained this by using :
>> Code:
>>             Category c = userHierarchy.getInstance("USER.Category1");
>>             System.out.println("category1 obtained was...."+c.getName());
>>             System.out.println("category1 priority
>is...."+c.getPriority());
>>
>>             Category cat = Category.getInstance("tester");
>>             System.out.println("category2 obtained
>was...."+cat.getName());
>>             System.out.println("category2 priority
>> is...."+cat.getPriority());
>>
>> Output:
>>
>>     category1 obtained was....USER.Category1
>>     category1 priority is....null.
>>     category2 obtained was....tester
>>     category2 priority is....null.
>>
>> However, I have tried using a Category name of:
>> "log4j.category.USER.Category1", with same result.
>>
>>
>> Read the following:
>> public static Category getInstance(String name)
>>   Retrieve a category with named as the name parameter. If the named
>> category already exists, then the existing instance will be reutrned.
>> Otherwise, a new instance is created. By default, categories do not have a
>> set priority but inherit it from the hierarchy. This is one of the central
>> features of log4j.
>>     Parameters:
>>     name - The name of the category to retrieve
>>
>>
>> I am creating my Hierarchy object like so:
>>         userHierarchy = new Hierarchy( Category.getInstance("USER") );
>>
>> If a Hierarchy is created with a Category that has no defined
>> Priority/Level, then what is the default?
>>
>>
>> Regards,
>>
>> T Master
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

--
Ceki Gülcü - http://qos.ch
Link of the day: http://www.washingtonpost.com/wp-dyn/articles/A63884-2001Oct15.html


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

Reply via email to