Hi,

(That mail could be for Dan who seems to work with log4j.)

I am trying to use log4j to debug my application.
(I could not download opensymphony...the download link is disabled)

This is how I set it up:

  static Category LOG4J = Category.getRoot();
    BasicConfigurator.configure();
    Layout layout = new PatternLayout("%d{HH:mm:ss} %-5p %c %x - %m%n");

        //not sure about the output. I have tried Syste.out as well
    LOG4J.addAppender(new FileAppender(layout, System.err));

        //no debugging if not set
    if((debugPriority = System.getProperty("debugLevel")) == null)
      LOG4J.setPriority(Priority.toPriority("FATAL"));

    if(LOG4J.isInfoEnabled()) LOG4J.info("Application started...");



I have 2 problems:
1) The statements are printed twice, but in different format:
The first one is the default one, the second one is the one I specify
        0 [ApplicationServerThread] INFO root  - Application started...
        20:12:37 INFO  root  - Application started...

2)As is it the log are printed on the console. Is is possible to redired
them to the application.log ???

Thanks,

Olivier


Reply via email to