Hello, 
No answer on my previous post... could somebody please help me on that error
?
I really do not understand why I get the "no appenders could be found..."
though I have specified an appender for the category...

Thanks, 

Axelle.


-----Message d'origine-----
De : Apvrille, Axelle 
Objet : log4j: ERROR No appenders could be found for category...

Hi,

I'm sorry I have to ask this question again, but I haven't seen the exact
answer to my problem or understood the answers... (?)

I've got the following complaints from log4j :
log4j:ERROR No appenders could be found for category
(worm.gui.TimestamperGUI).
log4j:ERROR Please initialize the log4j system properly.

I've read from the "troubleshooting guide" this is because there's no
appenders attached to my category or its ancestors. But I've done that ! My
configuration file is : 

log4j.rootCategory=DEBUG,MyFileAppender,MyConsoleAppender
[..Definition of MyFileAppender and MyConsoleAppender...]
log4j.category.worm=DEBUG,MyFileAppender, MyConsoleAppender

Isn't that last line attach worm category to my appenders ? If worm is an
ancestor of worm.gui.TimestampGUI, this should be okay ? 

-------
Other maybe useful information :
I'm passing my configuration file to the program through a system property :
java ... -Dlog4j.conf.file="log.properties" worm.gui.TimestampGUI

Then, in my application, I've got :
package worm.gui;
[...]
import org.apache.log4j.Category;
import org.apache.log4j.PropertyConfigurator;
public class TimestampGUI {
        static Category cat =
Category.getInstance(TimestamperGUI.class.getName());
        [...]
        public static void main(String args[]){
          cat.debug("--> main()");

          try {
            // setting up trace file
        
PropertyConfigurator.configure(System.getProperty("log4j.conf.file"));
            cat.info("Trace controller starts.");
          }
          catch(NullPointerException exp){
            // no logging configuration file has been specified
            // we disable logging
            Category.getDefaultHierarchy().disableAll();
          }
        }
}

Thanks for any explanation, I haven't understood other answers... 

Axelle.


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

Reply via email to