hi,

I've implemented Log4j using a singleton class which features :

        static Category c;

In the constructor the category is filled an a file-appender added. (next a 
config-file is read and levels are added)

        FileAppender fa = new FileAppender(new PatternLayout("%d{HH:mm:ss,SSS} 
%-5p [%t,%c]: %m%n"),lLog.getAbsolutePath());
        c = Category.getRoot();
        c.addAppender(fa);

Then I have one method which my other classes call to get their correct 
Category.

        public Category getLogger(String aClassName)
        {
                if (c.exists(aClassName) != null)
                {
                        return c.exists(aClassName);
                }
                else
                {
                        return c.getInstance(aClassName);
                }
        }

Are there any drawbacks to working this way ?

If no explicit priorities are set, it appears I get a null returned.
I assumed it would be the root-priority which has a default value ?

best,

Geert


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

Reply via email to