1.tomcat下面 Log4j.properties不认, 只认log4j.properties
resource url:
http://www.blogjava.net/zJun/archive/2006/06/30/55511.html#55860

2.关于“log4j:WARN Please initialize the log4j system properly”:
  你的tomcat/common/lib下是不是有个log4j的jar啊?删了试试!应该没问题。

resource url:http://www.yeyan.info/100-tomcat-t622836.htm

3.在tomcat中配置log4j似乎只要三步就可以实现了:
第一步:把log4j.jar放入$CATALINA_HOME/common/lib.
第二步:将log4j配置文件,可以是log4j.xml,log4j.properties;放进你的项目/WEB-INF/classes/目录下.
第三步:重启tomcat.

这样直接在.java程序中使用Logger,就可以按照配置文件输出日志了。

呜呜,157已经搬走了,只能回到学校试验一下。

可能自己以前就是因为没有把配置文件命名为log4j.properties,而是命名为了log4jconfig.properties,所以tomcat总是找不到这个配置文件。

4.在tomcat中配置log4j步骤补充:
  刚又查了几个权威资料,好像tomcat中配置log44j还必须下载commons-logging.jar (not commons-logging-api.jar) 和log4j.jar一起放到 $CATALINA_HOME/common/lib .
相关资料:
1.使用log4j为Tomcat输出日志
http://www.chinawin.net/myblog/archives/314-log4jTomcataeoeOE.html

1. 如果Tomcat当前正在运行,关闭Tomcat。
2. 从Apache的网站下载Commons Logging发行包。
3. 将压缩包中的commons-logging.jar解压缩到你Tomcat安装路径的common/lib目录中。
4. 从Apache的网站下载Log4j发行包。
5. 将压缩包中的log4j-1.2.12.jar解压缩到你Tomcat安装路径的common/lib目录中。
6. 在Tomcat安装路径的common/classes 创建log4j的配置文件log4j.properties(配置文件在随后一节)。
7. 重起Tomcat

2.Tomcat FAQ
Logging http://tomcat.apache.org/faq/logging.html#userWebapps

How should I log in my own webapps?
While you can use System.out and System.err to log, we strongly recommend using a toolkit like Log4J or JDK 1.4's java.util.logging package. With these toolkits, you have significantly more functionality (for example, sending emails, logging to a database, controlling at runtime the logging level of different classes, inspecting the logs with a graphical viewer, etc.) than with Tomcat's built-in default logging configuration.

We also recommend that you separate your logging from Tomcat's internal logging. That means you should bundle your logging toolkit with your webapp. If you're using Log4J, for example, place the Log4J jar in the WEB-INF/lib directory of your webapp and the Log4J configuration file in the WEB-INF/classes directory of your webapp. This way different web applications can have different logging configurations and you don't need to worry about them interfering with each other.

3.Logging in Tomcat
http://tomcat.apache.org/tomcat-5.5-doc/logging.html

Follow the following steps to setup a file named tomcat.log that has internal Tomcat logging output to it:

  1. Create a file called log4j.properties with the following content and save it into common/classes.
                log4j.rootLogger=debug, R 
    log4j.appender.R=org.apache.log4j.RollingFileAppender
    log4j.appender.R.File=${catalina.home}/logs/tomcat.log
    log4j.appender.R.MaxFileSize=10MB
    log4j.appender.R.MaxBackupIndex=10
    log4j.appender.R.layout=org.apache.log4j.PatternLayout
    log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
    log4j.logger.org.apache.catalina=DEBUG, R
  2. Download Log4J (v1.2 or later) and place the log4j jar in $CATALINA_HOME/common/lib.
  3. Download Commons Logging and place the commons-logging.jar (not commons-logging-api.jar) in $CATALINA_HOME/common/lib with the log4j jar.
  4. Start Tomcat


参考资料:
1.Tomcat5.5 with log4j 
http://itvincent.blog.hexun.com/5561505_d.html

2.log4j-1.2.9.在tomcat5.5下面的配置
http://www.cnblogs.com/zhoup/archive/2006/01/18/319817.aspx