Hi Jim,
  I included the 'class' attribute in the <category> element with the
name of the class file that is extending the Category class.
But i get a NoSuchMethodException:
log4j:ERROR Could not retrieve category [com.idini]. Reported error
follows.
java.lang.NoSuchMethodException: getInstance
        at java.lang.Class.getMethod0(Native Method)
        at java.lang.Class.getMethod(Class.java:920)
        at
org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.ja
va:294)
        at
org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:636)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:567)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:513)
        at
org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:5
82)
        at
com.idini.util.logManager.LogManager.init(LogManager.java:92)
        at
com.idini.util.logManager.LogManagerTester.main(LogManagerTester.java
:67)


This is the code of my custom category class:
public class Logger extends Category
{       
    private static LoggerFactory factory = new LoggerFactory();
    public Logger(String name){
        super(name);
    }
    public static Category getInstance(String name) {
        return (Category)getInstance(name, factory); 
    }    
}

Is there anything wrong in my approach.

Regs,
 Nirmala.


-----Original Message-----
From: Jim Moore [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 06, 2001 1:50 AM
To: 'LOG4J Users Mailing List'
Subject: RE: Classcast Exception....


It's the "class" attribute.  Look at the extension1.xml file in the
source
code.

-Jim Moore

-----Original Message-----
From: Nirmala Rajaram [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 7:09 PM
To: 'LOG4J Users Mailing List'
Subject: Classcast Exception....


I use a custom category class extended from Category.
There was a suggestion in the TROUBLESHOOT.html that a categoryFactory
key should be included in the property file. Can anyone tell me the
syntax to include the same in the XML based configuration file.

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

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

Reply via email to