我放到以下位置都不对(但也没有报错.)
myweb/
myweb/WEB-INF/classes/
myweb/WEB-INF/lib/
tomcat5.5/common/classes/

解决方案 »

  1.   

    /WEB-INF/classes 下面应该可以,但是你要保证类路径下面有 log4j-xx.jar 它才能起作用。
    否则的话他还是使用 Tomcat 自带的  logging.properties 或者 commons-loggings.properties 里面的配置。
      

  2.   

    在web程序中使用log4j注意问题1、    由于jsp或servlet在执行状态时没有当前路径概念,所有使用PropertyConfigurator.configure(String)语句找log4j.properties文件时要给出相对于当前jsp或servlet的路径转化成为一个绝对的文件系统路径。方法是使用servletcontext.getrealpath(string)语句。例://得到当前jsp路径String prefix =  getServletContext().getRealPath("/");//读取log4j.propertiesPropertyConfigurator.configure(prefix+"\\WEB-INF\\log4j.properties");2、相应的log4j.properties设置某个属性时也要在程序中设置绝对路径。例:log4j.appender.R.File属性设置日志文件存放位置。我们可以用读写.properties配置文件的方法进行灵活设置。
      

  3.   

    属性文件
    myweb/WEB-INF/classes/
    jar包
    myweb/WEB-INF/lib/