Thomas Chang wrote:
Hi all,
I use maven2 to build a webapp. I want to use the log4j. The dir-structure looks as follow: MyWeb/
    /src
       /main
          /java
          /res
       /webapp
          /WEB-INF
Now I have two questons: 1.
Where should I put the "log4j.properties"? I think it should be under 
/webapp//WEB-INF?

/webapp/WEB-INF/ is not in the classapth. Therefore, Log4j will not find it via auto-configuration. You will have to perform manual configuration to load this.

2.
How can the program find this file (I mean how to write in the java)?

Use the Servlet API.  
servletContext.getResourceAsStream("/WEB-INF/log4j.properties");


Jake

Regards
Thomas


---------------------------------
Ihr erstes Baby? Holen Sie sich Tipps von anderen Eltern.

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

Reply via email to