You have to call PropertyConfigurator.configure().
I have a JSP which gets run when tomcat starts.
It has a jspInit() method which calls an init class
I wrote which initializes log4j like this:

        URL url = Init.class.getResource(filename);
        PropertyConfigurator.configure(url);

To get tomcat to run the JSP at startup I have this in
my web.xml

<web-app>
  <servlet>
    <servlet-name>/Startup.jsp</servlet-name>
    <jsp-file>/Startup.jsp</jsp-file>
    <load-on-startup>1</load-on-startup>
  </servlet>

  ...

</web-app>

- Dan

----- Original Message ----- 
From: "Maxime Colas des Francs" <[EMAIL PROTECTED]>
Sent: Tuesday, October 01, 2002 9:08 AM

How to use log4j with a tomcat application ?

I put the log4j.properties in WEB-INF/classes
No error but no file created (certainly rights ?)

Can i put some log in a directory of the webapp ?




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

Reply via email to