在 Tomcat5.5中,
将commons-logging-1.1.jar,log4j-1.2.15.jar,复制到D:\Java\apache-tomcat-5.5.25\common\lib下面.
将log4j.properties复制到D:\Java\apache-tomcat-5.5.25\common\classes下面.
然后启动tomcat,就可以在D:\Java\apache-tomcat-5.5.25\logs下看到lizongbo.log了.
log4j.properties
内容为:
log4j.rootLogger=ERROR,R
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p]%t-%c-%m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/lizongbo.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=INFO,R,CONSOLE
#日志级别不能太低,如果配置为debug的话,输出的日志信息太多,导致tomcat启动非常的慢.
在Tomcat6.0中
将tomcat-juli-adapters.jar,log4j-1.2.15.jar,log4j.properties复制到D:\Java\ApacheTomcat6.0.14\lib下面.
将tomcat-juli.jar复制到D:\Java\apache-tomcat-6.0.14\bin\下面.
然后启动tomcat,就可以在D:\Java\apache-tomcat-6.0.14\logs下看到lizongbo.log了
Tomcat 6.0所需的juli替换文件:
http://www.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/extras/tomcat-juli-adapters.jar
http://www.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/extras/tomcat-juli.jar
posted on 2008-05-15 15:19
长春语林科技 阅读(1221)
评论(0) 编辑 收藏 所属分类:
java