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]

Reply via email to